History

checkpatch: yet another commit id improvement

Using \b isn't good enough to isolate what appears to be a commit id in a commit message. Make sure there is a space or a quote like character after a continuous run of hexadecimal characters that could be a commit id.

Joe Perches committed 10 years ago

Commit aab38f51 parent dadf6801 file · +2 −2Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+2−2
@@ -2459,9 +2459,9 @@ sub process { · 2458 unmodified lines
24592459
24602460 # Check for git id commit length and improperly formed commit descriptions
24612461 if ($in_commit_log && !$commit_log_possible_stack_dump &&
2462− $line !~ /^\s*(?:Link|Patchwork|http|BugLink):/i &&
2462+ $line !~ /^\s*(?:Link|Patchwork|http|https|BugLink):/i &&
24632463 ($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||
2464− ($line =~ /\b[0-9a-f]{12,40}\b/i &&
2464+ ($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[\s"'\(\[]|$)/i &&
24652465 $line !~ /[\<\[][0-9a-f]{12,40}[\>\]]/i &&
24662466 $line !~ /\bfixes:\s*[0-9a-f]{12,40}/i))) {
24672467 my $init_char = "c";

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t