All of lore.kernel.org
 help / color / mirror / Atom feed
From: joe@perches.com (Joe Perches)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] checkpatch: Add ability to coalesce commit descriptions on multiple lines
Date: Tue, 20 Jan 2015 14:25:16 -0800	[thread overview]
Message-ID: <1421792716.2724.11.camel@perches.com> (raw)
In-Reply-To: <1421660338.9655.21.camel@x220>

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>
Noticed-by: Paul Bolle <pebolle@tiscali.nl>
---
> Checkpatch in next-21050119 complains:
>     ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit fa0ce4035d48 ("ARM: 7162/1: errata: tidy up Kconfig options for PL310 errata workarounds")'
>     #7: 
>     commit fa0ce4035d48 ("ARM: 7162/1: errata: tidy up Kconfig options for
>     
>     total: 1 errors, 0 warnings, 14 lines checked
>     
>     Your patch has style problems, please review.
> 
> Perhaps it doesn't notice the quote spans two lines. Can this be fixed
> please?

Oh bother...

 scripts/checkpatch.pl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 41223c9..6a3baa0 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,

WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: Paul Bolle <pebolle@tiscali.nl>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Whitcroft <apw@canonical.com>,
	Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
	Gregory Clement <gregory.clement@free-electrons.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Russell King <linux@arm.linux.org.uk>,
	Valentin Rothberg <valentinrothberg@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] checkpatch: Add ability to coalesce commit descriptions on multiple lines
Date: Tue, 20 Jan 2015 14:25:16 -0800	[thread overview]
Message-ID: <1421792716.2724.11.camel@perches.com> (raw)
In-Reply-To: <1421660338.9655.21.camel@x220>

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>
Noticed-by: Paul Bolle <pebolle@tiscali.nl>
---
> Checkpatch in next-21050119 complains:
>     ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit fa0ce4035d48 ("ARM: 7162/1: errata: tidy up Kconfig options for PL310 errata workarounds")'
>     #7: 
>     commit fa0ce4035d48 ("ARM: 7162/1: errata: tidy up Kconfig options for
>     
>     total: 1 errors, 0 warnings, 14 lines checked
>     
>     Your patch has style problems, please review.
> 
> Perhaps it doesn't notice the quote spans two lines. Can this be fixed
> please?

Oh bother...

 scripts/checkpatch.pl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 41223c9..6a3baa0 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,



  reply	other threads:[~2015-01-20 22:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19  9:32 [PATCH v4] ARM: mvebu: remove two selects of ARM_ERRATA_753970 Paul Bolle
2015-01-19  9:32 ` Paul Bolle
2015-01-19  9:38 ` Paul Bolle
2015-01-19  9:38   ` Paul Bolle
2015-01-20 22:25   ` Joe Perches [this message]
2015-01-20 22:25     ` [PATCH] checkpatch: Add ability to coalesce commit descriptions on multiple lines Joe Perches
2015-01-20 22:44     ` Paul Bolle
2015-01-20 22:44       ` Paul Bolle
2015-01-19 11:39 ` [PATCH v4] ARM: mvebu: remove two selects of ARM_ERRATA_753970 Russell King - ARM Linux
2015-01-19 11:39   ` Russell King - ARM Linux
2015-01-21 10:42 ` Gregory CLEMENT
2015-01-21 10:42   ` Gregory CLEMENT

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421792716.2724.11.camel@perches.com \
    --to=joe@perches.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.