[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <926a2f22e12bf989d46dc36c8779c50183bf4b7e.camel@perches.com>
Date: Fri, 30 Oct 2020 05:10:09 -0700
From: Joe Perches <joe@...ches.com>
To: Aditya Srivastava <yashsri421@...il.com>
Cc: linux-kernel@...r.kernel.org,
linux-kernel-mentees@...ts.linuxfoundation.org,
lukas.bulwahn@...il.com, Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] checkpatch: add fix option for GERRIT_CHANGE_ID
On Fri, 2020-10-30 at 17:14 +0530, Aditya Srivastava wrote:
> Currently, whenever a Gerrit Change-Id is present in a commit,
> checkpatch.pl warns to remove the Change-Id before submitting the patch.
>
> E.g., running checkpatch on commit adc311a5bbf6 ("iwlwifi: bump FW
> API to 53 for 22000 series") reports this error:
>
> ERROR: Remove Gerrit Change-Id's before submitting upstream
> Change-Id: I5725e46394f3f53c3069723fd513cc53c7df383d
>
> Provide a simple fix option by simply deleting the indicated line.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -2852,8 +2852,11 @@ sub process {
>
>
> # Check for Gerrit Change-Ids not in any patch context
> if ($realfile eq '' && !$has_patch_separator && $line =~ /^\s*change-id:/i) {
> - ERROR("GERRIT_CHANGE_ID",
> - "Remove Gerrit Change-Id's before submitting upstream\n" . $herecurr);
> + if (ERROR("GERRIT_CHANGE_ID",
> + "Remove Gerrit Change-Id's before submitting upstream\n" . $herecurr) &&
> + $fix) {
> + fix_delete_line($fixlinenr, $rawline);
> + }
> }
Seems sensible, thanks.
It might also be sensible if the line before and the line after
this change-id is also blank to remove one of those blank lines.
On second thought:
A quick check shows less than 20 of those in kernel git history
so it might not be too worthwhile.
Acked-by: Joe Perches <joe@...ches.com>
Powered by blists - more mailing lists