checkpatch: relax check for length of git commit IDs

Checkpatch currently warns if a git commit ID (in the changelog,
usually) is less than 12 characters or more than 16.  The "more than 16"
is excessive.  Change the check so we accept IDs from 12 to 40 chars in
length.

Cc: Geert Uytterhoeven <geert@linux-m68k.org
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Joe Perches 2014-08-29 15:18:26 -07:00 committed by Linus Torvalds
parent 59753a8054
commit 3f6316b437
1 changed files with 2 additions and 2 deletions

View File

@ -2133,7 +2133,7 @@ sub process {
# Check for improperly formed commit descriptions # Check for improperly formed commit descriptions
if ($in_commit_log && if ($in_commit_log &&
$line =~ /\bcommit\s+[0-9a-f]{5,}/i && $line =~ /\bcommit\s+[0-9a-f]{5,}/i &&
$line !~ /\b[Cc]ommit [0-9a-f]{12,16} \("/) { $line !~ /\b[Cc]ommit [0-9a-f]{12,40} \("/) {
$line =~ /\b(c)ommit\s+([0-9a-f]{5,})/i; $line =~ /\b(c)ommit\s+([0-9a-f]{5,})/i;
my $init_char = $1; my $init_char = $1;
my $orig_commit = lc($2); my $orig_commit = lc($2);
@ -2141,7 +2141,7 @@ sub process {
my $desc = 'commit description'; my $desc = 'commit description';
($id, $desc) = git_commit_info($orig_commit, $id, $desc); ($id, $desc) = git_commit_info($orig_commit, $id, $desc);
ERROR("GIT_COMMIT_ID", ERROR("GIT_COMMIT_ID",
"Please use 12 to 16 chars for the git commit ID like: '${init_char}ommit $id (\"$desc\")'\n" . $herecurr); "Please use 12 or more chars for the git commit ID like: '${init_char}ommit $id (\"$desc\")'\n" . $herecurr);
} }
# Check for added, moved or deleted files # Check for added, moved or deleted files