Commit 66881735071e54283df38ffbd9584c63e3661b9f

Authored by Joe Perches
Committed by Linus Torvalds
1 parent caac7e6d00

checkpatch: allow commit descriptions on separate line from commit id

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 emds on the next line like:

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

Allow this form.

Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Joe Lawrence <joe.lawrence@stratus.com>
Tested-by: Joe Lawrence <joe.lawrence@stratus.com>
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

scripts/checkpatch.pl
... ... @@ -2133,7 +2133,10 @@
2133 2133 # Check for improperly formed commit descriptions
2134 2134 if ($in_commit_log &&
2135 2135 $line =~ /\bcommit\s+[0-9a-f]{5,}/i &&
2136   - $line !~ /\b[Cc]ommit [0-9a-f]{12,40} \("/) {
  2136 + !($line =~ /\b[Cc]ommit [0-9a-f]{12,40} \("/ ||
  2137 + ($line =~ /\b[Cc]ommit [0-9a-f]{12,40}\s*$/ &&
  2138 + defined $rawlines[$linenr] &&
  2139 + $rawlines[$linenr] =~ /^\s*\("/))) {
2137 2140 $line =~ /\b(c)ommit\s+([0-9a-f]{5,})/i;
2138 2141 my $init_char = $1;
2139 2142 my $orig_commit = lc($2);