aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2017-07-10 18:52:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-10 19:32:35 -0400
commit948b133a1b62441bd2ae98b866f409017191fdd3 (patch)
tree69ce7aa533ad9457992f52ef8ad65687d7233c17 /scripts
parentca8198640fa9aeea71ae61b02fee6ee5e097f243 (diff)
checkpatch: remove false warning for commit reference
Checkpatch warns of an incorrect commit reference style for any hexadecimal number of 12 digits and more. Numbers of 12 digits are not necessarily commit ids. For an example provoking the problem see https://patchwork.kernel.org/patch/9170897/ Checkpatch should only warn if the number refers to an existing commit. Link: http://lkml.kernel.org/r/20170607184008.5869-1-xypron.glpk@gmx.de Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2f61f54b8940..e9618ca31251 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -867,6 +867,7 @@ sub git_commit_info {
867# echo "commit $(cut -c 1-12,41-)" 867# echo "commit $(cut -c 1-12,41-)"
868# done 868# done
869 } elsif ($lines[0] =~ /^fatal: ambiguous argument '$commit': unknown revision or path not in the working tree\./) { 869 } elsif ($lines[0] =~ /^fatal: ambiguous argument '$commit': unknown revision or path not in the working tree\./) {
870 $id = undef;
870 } else { 871 } else {
871 $id = substr($lines[0], 0, 12); 872 $id = substr($lines[0], 0, 12);
872 $desc = substr($lines[0], 41); 873 $desc = substr($lines[0], 41);
@@ -2606,7 +2607,8 @@ sub process {
2606 ($id, $description) = git_commit_info($orig_commit, 2607 ($id, $description) = git_commit_info($orig_commit,
2607 $id, $orig_desc); 2608 $id, $orig_desc);
2608 2609
2609 if ($short || $long || $space || $case || ($orig_desc ne $description) || !$hasparens) { 2610 if (defined($id) &&
2611 ($short || $long || $space || $case || ($orig_desc ne $description) || !$hasparens)) {
2610 ERROR("GIT_COMMIT_ID", 2612 ERROR("GIT_COMMIT_ID",
2611 "Please use git commit description style 'commit <12+ chars of sha1> (\"<title line>\")' - ie: '${init_char}ommit $id (\"$description\")'\n" . $herecurr); 2613 "Please use git commit description style 'commit <12+ chars of sha1> (\"<title line>\")' - ie: '${init_char}ommit $id (\"$description\")'\n" . $herecurr);
2612 } 2614 }