Skip to contentSkip to conversation

checkpatch: add fix option for ERROR:GERRIT_CHANGE_ID

PATCH In review Aditya Srivastava 2 participants 5 messages Oct 30, 2020 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: add fix option for ERROR:GERRIT_CHANGE_ID

Currently, whenever gerrit change id is present in commit, checkpatch.pl gives an error to remove the change id before submitting the patch.

For eg, running checkpatch on commit adc311a5bbf6 ("iwlwifi: bump FW API to 53 for 22000 series"), causes error:

ERROR:GERRIT_CHANGE_ID: Remove Gerrit Change-Id's before submitting upstream
Change-Id: I5725e46394f3f53c3069723fd513cc53c7df383d

But there is no --fix option present for this error message, in case user wants to fix it immediately.

To fix this error, delete the corresponding line from the patchfile when checkpatch.pl is executed with --fix

---
 scripts/checkpatch.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +5 -2
index 7800a090e8fe..5329927fc1c1 100755
@@ -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
Signature · 6 lines
2.17.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
author
#1 lore raw
Quoted 30 lines · Aditya Srivastava

Currently, whenever gerrit change id is present in commit, checkpatch.pl gives an error to remove the change id before submitting the patch.

For eg, running checkpatch on commit adc311a5bbf6 ("iwlwifi: bump FW API to 53 for 22000 series"), causes error:

ERROR:GERRIT_CHANGE_ID: Remove Gerrit Change-Id's before submitting upstream
Change-Id: I5725e46394f3f53c3069723fd513cc53c7df383d

But there is no --fix option present for this error message, in case user wants to fix it immediately.

To fix this error, delete the corresponding line from the patchfile when checkpatch.pl is executed with --fix

---
 scripts/checkpatch.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +0 -0
index 7800a090e8fe..5329927fc1c1 100755
@@ -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) {

scripts/checkpatch.pl sub process { · line 2862

Quoted 10 lines
scripts/checkpatch.pl +5 -2
-			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

Sir I have a doubt: Can I start working on another patch and send that too before the first one gets accepted?

Thanks
Aditya
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#2 lore raw
Quoted 39 lines · Aditya
Quoted 38 lines · Aditya Srivastava

Currently, whenever gerrit change id is present in commit, checkpatch.pl gives an error to remove the change id before submitting the patch.

For eg, running checkpatch on commit adc311a5bbf6 ("iwlwifi: bump FW API to 53 for 22000 series"), causes error:

ERROR:GERRIT_CHANGE_ID: Remove Gerrit Change-Id's before submitting upstream
Change-Id: I5725e46394f3f53c3069723fd513cc53c7df383d

But there is no --fix option present for this error message, in case user wants to fix it immediately.

To fix this error, delete the corresponding line from the patchfile when checkpatch.pl is executed with --fix

---
 scripts/checkpatch.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +5 -2
index 7800a090e8fe..5329927fc1c1 100755
@@ -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);
+                        }
 		}
 
Quoted 6 lines

scripts/checkpatch.pl sub process { · line 2862

Quoted 2 lines
scripts/checkpatch.pl +0 -0
 # Check if the commit log is in a possible stack dump

Sir I have a doubt: Can I start working on another patch and send that too before the first one gets accepted?

Sure, you can parallelize your work as much as you can. Review takes some time: we all have other full-time jobs and many other tasks.

When you get feedback, though, I suggest to take that feedback immediately and consider reworking your patch.

Lukas
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

author
#3 lore raw
Quoted 50 lines · Lukas Bulwahn
Quoted 39 lines · Aditya
Quoted 38 lines · Aditya Srivastava

Currently, whenever gerrit change id is present in commit, checkpatch.pl gives an error to remove the change id before submitting the patch.

For eg, running checkpatch on commit adc311a5bbf6 ("iwlwifi: bump FW API to 53 for 22000 series"), causes error:

ERROR:GERRIT_CHANGE_ID: Remove Gerrit Change-Id's before submitting upstream
Change-Id: I5725e46394f3f53c3069723fd513cc53c7df383d

But there is no --fix option present for this error message, in case user wants to fix it immediately.

To fix this error, delete the corresponding line from the patchfile when checkpatch.pl is executed with --fix

---
 scripts/checkpatch.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +5 -2
index 7800a090e8fe..5329927fc1c1 100755
@@ -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);
+                        }
 		}
 
Quoted 6 lines

scripts/checkpatch.pl sub process { · line 2862

Quoted 2 lines
scripts/checkpatch.pl +0 -0
 # Check if the commit log is in a possible stack dump

Sir I have a doubt: Can I start working on another patch and send that too before the first one gets accepted?

Quoted 9 lines

Sure, you can parallelize your work as much as you can. Review takes some time: we all have other full-time jobs and many other tasks.

When you get feedback, though, I suggest to take that feedback immediately and consider reworking your patch.

Lukas

Thanks Sir. Sure, will keep that in mind.

Aditya
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#4 lore raw
In reply to Aditya Srivastava

I would drop the ERROR:, just say: add fix option for GERRIT_CHANGE_ID

Quoted 1 line · Aditya Srivastava

Currently, whenever gerrit change id is present in commit, checkpatch.pl

...whenever a Gerrir Change-Id is present in a commit,

Quoted 2 lines

gives an error to remove the change id before submitting the patch.

s/gives an error/warns/
s/change id/Change-Id/

Quoted 1 line

For eg, running checkpatch on commit adc311a5bbf6 ("iwlwifi: bump FW

Just: "E.g.," not "For eg"

Quoted 1 line

API to 53 for 22000 series"), causes error:

s/causes error/reports this error/

Quoted 5 lines

ERROR:GERRIT_CHANGE_ID: Remove Gerrit Change-Id's before submitting upstream
Change-Id: I5725e46394f3f53c3069723fd513cc53c7df383d

The default setup does not show the type name, I would suggest to just show the default output from checkpatch.pl.

Quoted 6 lines

But there is no --fix option present for this error message, in case user wants to fix it immediately.

To fix this error, delete the corresponding line from the patchfile when checkpatch.pl is executed with --fix

Provide a simple fix option by simply deleting the indicated line.

Quoted 10 lines
---
 scripts/checkpatch.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +0 -0
index 7800a090e8fe..5329927fc1c1 100755

scripts/checkpatch.pl sub process { · line 2859

Quoted 10 lines
scripts/checkpatch.pl +5 -2
@@ -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);
+                        }

The change itself looks good to me.

Rework the commit message, send it out again here for a second check and if it is fine then you can submit it to Joe and lkml.

Quoted 7 lines
scripts/checkpatch.pl +0 -0
 		}
 
 # Check if the commit log is in a possible stack dump
Signature · 1 line
2.17.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees