From b671fde0572af42495ce3183969b0cafa98fd9ec Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Fri, 13 Feb 2015 14:38:41 -0800 Subject: [PATCH] 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 ("some long description") Signed-off-by: Joe Perches Reported-by: Paul Bolle Tested-by: Paul Bolle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/checkpatch.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 41223c946808..6a3baa0bdde8 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -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, -- 2.20.1