Skip to content

Commit b671fde

Browse files
JoePerchestorvalds
authored andcommitted
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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent acd9362 commit b671fde

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/checkpatch.pl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,6 +2198,13 @@ sub process {
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,

0 commit comments

Comments
 (0)