Messages in this thread | | | From | John Stultz <> | Date | Tue, 25 Feb 2020 09:45:17 -0800 | Subject | Re: [RFC][PATCH] checkpatch: Properly warn if Change-Id comes after first Signed-off-by line |
| |
On Mon, Feb 24, 2020 at 10:50 PM Joe Perches <joe@perches.com> wrote: > > 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 >
Yep. This works well for me, catching Change-Id lines that are missed by the current code.
Tested-by: John Stultz <john.stultz@linaro.org>
Thanks so much! -john
| |