linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] checkpatch: Add test for commit id formatting style in commit log
@ 2014-08-27 17:11 Joe Lawrence
  2014-08-28  1:38 ` [PATCH] checkpatch: Allow commit descriptions on separate line from commit id Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Lawrence @ 2014-08-27 17:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: Joe Perches, Andrew Morton

> Try to standardize on a 12 character long lower case
> commit id along with a description of parentheses and
> the quoted subject line
>
> ie: commit 0123456789ab ("commit description")

Hi Joe / Andrew,

I don't know if checkpatch is built for multiline regex, but I noticed
that this new check complained about the following commit message:

...
The PCI register read checking introduced in commit fe1b806f4f71
("qla2xxx: Disable adapter when we encounter a PCI disconnect") is
...

where 'commit hash ("message")' is split on multiple lines.

Dunno if that behavior is easily fixed, but thought I would report it.

Regards,

-- Joe

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] checkpatch: Allow commit descriptions on separate line from commit id
  2014-08-27 17:11 [PATCH] checkpatch: Add test for commit id formatting style in commit log Joe Lawrence
@ 2014-08-28  1:38 ` Joe Perches
  2014-08-28  3:28   ` Joe Lawrence
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2014-08-28  1:38 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Andy Whitcroft, Geert Uytterhoeven, Joe Lawrence, LKML

The general form for commit id and description is

'Commit <12+hexdigits> ("commit description/subject line")'

But commit logs often have relatively long commit ids and
the commit description is on a separate line like:

Some explanation as to why commit <12+hexdigits>
("commit description/subject line") is improved.

Allow this form.

Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Joe Lawrence <joe.lawrence@stratus.com
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d89857d..4d869dd 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2133,7 +2133,10 @@ sub process {
 # Check for improperly formed commit descriptions
 		if ($in_commit_log &&
 		    $line =~ /\bcommit\s+[0-9a-f]{5,}/i &&
-		    $line !~ /\b[Cc]ommit [0-9a-f]{12,40} \("/) {
+		    !($line =~ /\b[Cc]ommit [0-9a-f]{12,40} \("/ ||
+		      ($line =~ /\b[Cc]ommit [0-9a-f]{12,40}\s*$/ &&
+		       defined $rawlines[$linenr] &&
+		       $rawlines[$linenr] =~ /^\s*\("/))) {
 			$line =~ /\b(c)ommit\s+([0-9a-f]{5,})/i;
 			my $init_char = $1;
 			my $orig_commit = lc($2);



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] checkpatch: Allow commit descriptions on separate line from commit id
  2014-08-28  1:38 ` [PATCH] checkpatch: Allow commit descriptions on separate line from commit id Joe Perches
@ 2014-08-28  3:28   ` Joe Lawrence
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Lawrence @ 2014-08-28  3:28 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andrew Morton, Andy Whitcroft, Geert Uytterhoeven, Joe Lawrence, LKML


On Wed, 27 Aug 2014, Joe Perches wrote:

> The general form for commit id and description is
> 
> 'Commit <12+hexdigits> ("commit description/subject line")'
> 
> But commit logs often have relatively long commit ids and
> the commit description is on a separate line like:
> 
> Some explanation as to why commit <12+hexdigits>
> ("commit description/subject line") is improved.
> 
> Allow this form.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> Suggested-by: Joe Lawrence <joe.lawrence@stratus.com

Hi Joe,

The script changes work for me, one really minor nit though, this email 
address is missing a closing '>'.  (Maybe another checkpatch validation 
for another day?)

Thanks,

-- Joe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-28  3:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-27 17:11 [PATCH] checkpatch: Add test for commit id formatting style in commit log Joe Lawrence
2014-08-28  1:38 ` [PATCH] checkpatch: Allow commit descriptions on separate line from commit id Joe Perches
2014-08-28  3:28   ` Joe Lawrence

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).