History

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: Joe Perches <joe@perches.com> Reported-by: Paul Bolle <pebolle@tiscali.nl> Tested-by: Paul Bolle <pebolle@tiscali.nl>

Joe Perches committed 11 years ago

Commit b671fde1 parent acd93621 file · +7 −0Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+7−0
@@ -2198,6 +2198,13 @@ sub process { · 2197 unmodified lines
21982198 defined $rawlines[$linenr] &&
21992199 $rawlines[$linenr] =~ /^\s*\("([^"]+)"\)/) {
22002200 $orig_desc = $1;
2201+ } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("[^"]+$/i &&
2202+ defined $rawlines[$linenr] &&
2203+ $rawlines[$linenr] =~ /^\s*[^"]+"\)/) {
2204+ $line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)$/i;
2205+ $orig_desc = $1;
2206+ $rawlines[$linenr] =~ /^\s*([^"]+)"\)/;
2207+ $orig_desc .= " " . $1;
22012208 }
22022209
22032210 ($id, $description) = git_commit_info($orig_commit,