* [PATCH] checkpatch: Reduce git commit description style false positives
[not found] <20160527134341.220d15e6cae99e17f2cbc879@linux-foundation.org>
@ 2016-05-27 21:20 ` Joe Perches
2016-05-27 21:50 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2016-05-27 21:20 UTC (permalink / raw)
To: Andrew Morton, Andy Whitcroft; +Cc: linux-kernel
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")'
Link: http://lkml.kernel.org/r/40e03fd7aaf1f55c75d787128d6d17c5a71226c2.1464358556.git.vdavydov@virtuozzo.com
Reduce the false positives.
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Joe Perches <joe@perches.com>
---
scripts/checkpatch.pl | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 6750595..4904ced 100755
--- a/scripts/checkpatch.pl
+++ b/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 &&
--
2.8.0.rc4.16.g56331f8
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] checkpatch: Reduce git commit description style false positives
2016-05-27 21:20 ` [PATCH] checkpatch: Reduce git commit description style false positives Joe Perches
@ 2016-05-27 21:50 ` Andrew Morton
2016-05-27 21:52 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2016-05-27 21:50 UTC (permalink / raw)
To: Joe Perches; +Cc: Andy Whitcroft, linux-kernel
On Fri, 27 May 2016 14:20:42 -0700 Joe Perches <joe@perches.com> 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")'
> Link: http://lkml.kernel.org/r/40e03fd7aaf1f55c75d787128d6d17c5a71226c2.1464358556.git.vdavydov@virtuozzo.com
>
> Reduce the false positives.
>
hm, I still get the falsie when checking this very patch.
From: Joe Perches <joe@perches.com>
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")'
Link: http://lkml.kernel.org/r/40e03fd7aaf1f55c75d787128d6d17c5a71226c2.1464358556.git.vdavydov@virtuozzo.com
Reduce the false positives.
Link: http://lkml.kernel.org/r/eda977eaa8328fef42bb3c87935d97e10ea8ff67.1464384023.git.joe@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
scripts/checkpatch.pl | 1 +
1 file changed, 1 insertion(+)
diff -puN scripts/checkpatch.pl~checkpatch-reduce-git-commit-description-style-false-positives scripts/checkpatch.pl
--- a/scripts/checkpatch.pl~checkpatch-reduce-git-commit-description-style-false-positives
+++ a/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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] checkpatch: Reduce git commit description style false positives
2016-05-27 21:50 ` Andrew Morton
@ 2016-05-27 21:52 ` Joe Perches
0 siblings, 0 replies; 3+ messages in thread
From: Joe Perches @ 2016-05-27 21:52 UTC (permalink / raw)
To: Andrew Morton; +Cc: Andy Whitcroft, linux-kernel
On Fri, 2016-05-27 at 14:50 -0700, Andrew Morton wrote:
> On Fri, 27 May 2016 14:20:42 -0700 Joe Perches <joe@perches.com>
> 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")'
> > Link: http://lkml.kernel.org/r/40e03fd7aaf1f55c75d787128d6d17c5a7122
> > 6c2.1464358556.git.vdavydov@virtuozzo.com
> >
> > Reduce the false positives.
> >
> hm, I still get the falsie when checking this very patch.
because commit 0123456789ab doesn't exist
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-27 21:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20160527134341.220d15e6cae99e17f2cbc879@linux-foundation.org>
2016-05-27 21:20 ` [PATCH] checkpatch: Reduce git commit description style false positives Joe Perches
2016-05-27 21:50 ` Andrew Morton
2016-05-27 21:52 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).