mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: John Stultz <john.stultz@linaro.org>
Cc: lkml <linux-kernel@vger.kernel.org>, Andy Whitcroft <apw@canonical.com>
Subject: Re: [RFC][PATCH] checkpatch: Properly warn if Change-Id comes after first Signed-off-by line
Date: Mon, 24 Feb 2020 22:49:15 -0800	[thread overview]
Message-ID: <187fa03a3690806748ca7cfd2b61728c0d33dcf0.camel@perches.com> (raw)
In-Reply-To: <CALAqxLW7xjPh8SZtZ+ES9fghdMDQZfG_ToSrX+u7DMAOixyQ1Q@mail.gmail.com>

On Mon, 2020-02-24 at 20:48 -0800, John Stultz wrote:
> On Mon, Feb 24, 2020 at 6:13 PM Joe Perches <joe@perches.com> wrote:
> > On Mon, 2020-02-24 at 23:58 +0000, John Stultz wrote:
> > > Quite often, the Change-Id may be between Signed-off-by: lines or
> > > at the end of them. Unfortunately checkpatch won't catch these
> > > cases as it disables in_commit_log when it catches the first
> > > Signed-off-by line.
> > > 
> > > This has bitten me many many times.
> > 
> > Hmm.  When is change-id used in your workflow?
> 
> Since I have a few kernel repos that I use for both upstream work and
> work targeting AOSP trees, I usually have the gerrit commit hook
> enabled in my tree (its easier to strip with sed then it is to re-add
> after submitting to gerrit), and at least the commit-msg hook I have
> will usually append a Change-Id: line at the end of the commit
> message, usually after the signed-off-by line.

Perhaps this is better:
---
 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a63380..698c7c8 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2721,9 +2721,9 @@ sub process {
 		}
 
 # Check for unwanted Gerrit info
-		if ($in_commit_log && $line =~ /^\s*change-id:/i) {
+		if ($realfile eq '' && $line =~ /^\s*change-id:/i) {
 			ERROR("GERRIT_CHANGE_ID",
-			      "Remove Gerrit Change-Id's before submitting upstream.\n" . $herecurr);
+			      "Remove Gerrit Change-Id's before submitting upstream\n" . $herecurr);
 		}
 
 # Check if the commit log is in a possible stack dump



  reply	other threads:[~2020-02-25  6:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24 23:58 John Stultz
2020-02-25  2:12 ` Joe Perches
2020-02-25  4:48   ` John Stultz
2020-02-25  6:49     ` Joe Perches [this message]
2020-02-25 17:45       ` John Stultz
2020-02-25 18:02         ` Joe Perches
2020-02-25 20:14         ` Joe Perches
2020-02-25 21:33           ` John Stultz
2020-02-25 22:16         ` [PATCH] checkpatch: Improve Gerrit Change-Id: test Joe Perches

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=187fa03a3690806748ca7cfd2b61728c0d33dcf0.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®