Commit 66881735 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

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: default avatarJoe Perches <joe@perches.com>
Suggested-by: default avatarJoe Lawrence <joe.lawrence@stratus.com>
Tested-by: default avatarJoe Lawrence <joe.lawrence@stratus.com>
Suggested-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent caac7e6d
...@@ -2133,7 +2133,10 @@ sub process { ...@@ -2133,7 +2133,10 @@ sub process {
# Check for improperly formed commit descriptions # Check for improperly formed commit descriptions
if ($in_commit_log && if ($in_commit_log &&
$line =~ /\bcommit\s+[0-9a-f]{5,}/i && $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; $line =~ /\b(c)ommit\s+([0-9a-f]{5,})/i;
my $init_char = $1; my $init_char = $1;
my $orig_commit = lc($2); my $orig_commit = lc($2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment