Skip to contentSkip to conversation

checkpatch: Reduce git commit description style false positives

PATCH Applied Joe Perches 2 participants 3 messages May 27, 2016 1 message not in the archive Checkpatch

lore
Share & tools
lore

Joe Perches

author maintainer
#1 lore raw

PATCH 1/1 checkpatch: Reduce git commit description style false positives

In reply to a message not in the archive

Some lines in a commit log appear to be commit SHA1 ids like:

ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 0123456789ab ("commit description")'

Reduce the false positives.

---
 scripts/checkpatch.pl | 1 +
 1 file changed, 1 insertion(+)
scripts/checkpatch.pl +1 -0
index 6750595..4904ced 100755
@@ -2454,6 +2454,7 @@ sub process {
 
 # Check for git id commit length and improperly formed commit descriptions
 		if ($in_commit_log && !$commit_log_possible_stack_dump &&
+		    $line !~ /^\s*(?:Link|Patchwork|http|BugLink):/i &&
 		    ($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||
 		     ($line =~ /\b[0-9a-f]{12,40}\b/i &&
 		      $line !~ /[\<\[][0-9a-f]{12,40}[\>\]]/i &&
Signature · 1 line
2.8.0.rc4.16.g56331f8
#2 lore raw
Quoted 7 lines · On Fri, 27 May 2016 14:20:42 -0700 Joe Perches <[email protected]> wrote:

Some lines in a commit log appear to be commit SHA1 ids like:

ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 0123456789ab ("commit description")'

Reduce the false positives.

hm, I still get the falsie when checking this very patch.

From: Joe Perches <[email protected]>
Subject: checkpatch: reduce git commit description style false positives

Some lines in a commit log appear to be commit SHA1 ids like:

ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 0123456789ab ("commit description")'

Reduce the false positives.

---

 scripts/checkpatch.pl |    1 +
 1 file changed, 1 insertion(+)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-reduce-git-commit-description-style-false-positives +1 -0
diff -puN scripts/checkpatch.pl~checkpatch-reduce-git-commit-description-style-false-positives scripts/checkpatch.pl
@@ -2454,6 +2454,7 @@ sub process {
 
 # Check for git id commit length and improperly formed commit descriptions
 		if ($in_commit_log && !$commit_log_possible_stack_dump &&
+		    $line !~ /^\s*(?:Link|Patchwork|http|BugLink):/i &&
 		    ($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||
 		     ($line =~ /\b[0-9a-f]{12,40}\b/i &&
 		      $line !~ /[\<\[][0-9a-f]{12,40}[\>\]]/i &&

_

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#6:
ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 0123456789ab ("commit description")'

Perhaps we could special-case the "unwrapped commit description" as well - the Link: lines are almost always too wide.

author maintainer
#3 lore raw
Quoted 12 lines · Andrew Morton
Quoted 9 lines · On Fri, 27 May 2016 14:20:42 -0700 Joe Perches <[email protected]> wrote:

Some lines in a commit log appear to be commit SHA1 ids like:

ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 0123456789ab ("commit description")'

[email protected]

Quoted 3 lines
Quoted 2 lines

Reduce the false positives.

hm, I still get the falsie when checking this very patch.

because commit 0123456789ab doesn't exist