checkpatch: add ability to coalesce commit descriptions on multiple lines
authorJoe Perches <joe@perches.com>
Fri, 13 Feb 2015 22:38:41 +0000 (14:38 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 14 Feb 2015 05:21:39 +0000 (21:21 -0800)
If a git commit description is split on consecutive lines, coalesce it
before testing.

This allows:

  commit <foo> ("some long
  description")

Signed-off-by: Joe Perches <joe@perches.com>
Reported-by: Paul Bolle <pebolle@tiscali.nl>
Tested-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl

index 41223c9..6a3baa0 100755 (executable)
@@ -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,