* [Linux-kernel-mentees] [PATCH] checkpatch: add fix option for GERRIT_CHANGE_ID
@ 2020-10-30 11:30 Aditya Srivastava
2020-10-30 11:36 ` Lukas Bulwahn
0 siblings, 1 reply; 4+ messages in thread
From: Aditya Srivastava @ 2020-10-30 11:30 UTC (permalink / raw)
To: lukas.bulwahn; +Cc: linux-kernel-mentees, Aditya Srivastava
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.
Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
---
scripts/checkpatch.pl | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7800a090e8fe..5329927fc1c1 100755
--- 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);
+ }
}
# Check if the commit log is in a possible stack dump
--
2.17.1
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Linux-kernel-mentees] [PATCH] checkpatch: add fix option for GERRIT_CHANGE_ID
2020-10-30 11:30 [Linux-kernel-mentees] [PATCH] checkpatch: add fix option for GERRIT_CHANGE_ID Aditya Srivastava
@ 2020-10-30 11:36 ` Lukas Bulwahn
0 siblings, 0 replies; 4+ messages in thread
From: Lukas Bulwahn @ 2020-10-30 11:36 UTC (permalink / raw)
To: Aditya Srivastava; +Cc: linux-kernel-mentees
On Fri, 30 Oct 2020, 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:
>
you can drop the "," before reports here.
Otherwise looks good, do that minor fix and send it out to lkml.
> ERROR: Remove Gerrit Change-Id's before submitting upstream
> Change-Id: I5725e46394f3f53c3069723fd513cc53c7df383d
>
> Provide a simple fix option by simply deleting the indicated line.
>
> Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
> ---
> scripts/checkpatch.pl | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 7800a090e8fe..5329927fc1c1 100755
> --- 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);
> + }
> }
>
> # Check if the commit log is in a possible stack dump
> --
> 2.17.1
>
>
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Linux-kernel-mentees] [PATCH] checkpatch: add fix option for GERRIT_CHANGE_ID
2020-10-30 11:44 Aditya Srivastava
@ 2020-10-30 12:10 ` Joe Perches
0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2020-10-30 12:10 UTC (permalink / raw)
To: Aditya Srivastava; +Cc: Andrew Morton, linux-kernel-mentees, linux-kernel
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@perches.com>
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Linux-kernel-mentees] [PATCH] checkpatch: add fix option for GERRIT_CHANGE_ID
@ 2020-10-30 11:44 Aditya Srivastava
2020-10-30 12:10 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Aditya Srivastava @ 2020-10-30 11:44 UTC (permalink / raw)
To: joe; +Cc: linux-kernel-mentees, linux-kernel, Aditya Srivastava
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.
Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
---
scripts/checkpatch.pl | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7800a090e8fe..5329927fc1c1 100755
--- 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);
+ }
}
# Check if the commit log is in a possible stack dump
--
2.17.1
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-10-30 12:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30 11:30 [Linux-kernel-mentees] [PATCH] checkpatch: add fix option for GERRIT_CHANGE_ID Aditya Srivastava
2020-10-30 11:36 ` Lukas Bulwahn
2020-10-30 11:44 Aditya Srivastava
2020-10-30 12:10 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).