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

checkpatch: add ability to coalesce commit descriptions on multiple lines

If a git commit description is split on consecutive lines, coalesce it
before testing.

This allows:

  commit <foo> ("some long
  description")
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Reported-by: default avatarPaul Bolle <pebolle@tiscali.nl>
Tested-by: default avatarPaul Bolle <pebolle@tiscali.nl>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent acd9362c
......@@ -2198,6 +2198,13 @@ sub process {
defined $rawlines[$linenr] &&
$rawlines[$linenr] =~ /^\s*\("([^"]+)"\)/) {
$orig_desc = $1;
} elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("[^"]+$/i &&
defined $rawlines[$linenr] &&
$rawlines[$linenr] =~ /^\s*[^"]+"\)/) {
$line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)$/i;
$orig_desc = $1;
$rawlines[$linenr] =~ /^\s*([^"]+)"\)/;
$orig_desc .= " " . $1;
}
($id, $description) = git_commit_info($orig_commit,
......
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