Skip to contentSkip to conversation

checkpatch.pl: add switch to turn off check for Change-Id

PATCH Pottratz, Dwane 2 participants 2 messages Mar 1, 2016 1 message not in the archive Checkpatch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Was this patch received? Where can I find the review status of it?

Thanks,
-Dwane

-----Original Message-----
From: Pottratz, Dwane
Sent: Tuesday, February 23, 2016 9:11 AM
To: [email protected]; [email protected]; [email protected]
Cc: Pottratz, Dwane <[email protected]>
Subject: [PATCH] checkpatch.pl: add switch to turn off check for Change-Id

A commit hook for the Gerrit code review servers inserts change indeftifiers. These identifiers are noise in the context of the upstream kernel. However, they are needed in most developement environments and the error needs to be ignored for static analysis tools.

---
 scripts/checkpatch.pl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
scripts/checkpatch.pl +4 -1
@@ -21,6 +21,7 @@ use Getopt::Long qw(:config no_auto_abbrev);  my $quiet = 0;  my $tree = 1;  my $chk_signoff = 1;
+my $chk_changeid = 1;
 my $chk_patch = 1;
 my $tst_only;
 my $emacs = 0;
@@ -64,6 +65,7 @@ Options:
   -q, --quiet                quiet
   --no-tree                  run without a kernel tree
   --no-signoff               do not check for 'Signed-off-by' line
+  --no-changeid              do not check for 'Change-Id' line
   --patch                    treat FILE as patchfile (default)
   --emacs                    emacs compile window format
   --terse                    one line per report
@@ -136,6 +138,7 @@ GetOptions(
 	'q|quiet+'	=> \$quiet,
 	'tree!'		=> \$tree,
 	'signoff!'	=> \$chk_signoff,
+	'changeid!'	=> \$chk_changeid,
 	'patch!'	=> \$chk_patch,
 	'emacs!'	=> \$emacs,
 	'terse!'	=> \$terse,
@@ -2332,7 +2335,7 @@ sub process {
 		}
 
 # Check for unwanted Gerrit info
-		if ($in_commit_log && $line =~ /^\s*change-id:/i) {
+		if ($in_commit_log && $line =~ /^\s*change-id:/i && $chk_changeid) {
 			ERROR("GERRIT_CHANGE_ID",
 			      "Remove Gerrit Change-Id's before submitting upstream.\n" . $herecurr);
 		}

--
1.9.1

maintainer
#2 lore raw
Quoted 1 line · Dwane

Was this patch received?  Where can I find the review status of it?

I don't recall seeing it before, but it seems sensible enough.

Quoted 53 lines

Thanks,
-Dwane

-----Original Message-----
From: Pottratz, Dwane
Sent: Tuesday, February 23, 2016 9:11 AM
To: [email protected]; [email protected]; [email protected]
Cc: Pottratz, Dwane <[email protected]>
Subject: [PATCH] checkpatch.pl: add switch to turn off check for Change-Id

A commit hook for the Gerrit code review servers inserts change indeftifiers.  These identifiers are noise in the context of the upstream kernel.  However, they are needed in most developement environments and the error needs to be ignored for static analysis tools.

---
 scripts/checkpatch.pl | 5 ++++-

 1 file changed, 4 insertions(+), 1 deletion(-)
scripts/checkpatch.pl +1 -0
@@ -21,6 +21,7 @@ use Getopt::Long qw(:config no_auto_abbrev);  my $quiet = 0;  my $tree = 1;  my $chk_signoff = 1;
+my $chk_changeid = 1;
  my $chk_patch = 1;
  my $tst_only;
  my $emacs = 0;
@@ -64,6 +65,7 @@ Options:

   -q, --quiet                quiet
   --no-tree                  run without a kernel tree --no-signoff               do not check for 'Signed-off-by' line +  --no-changeid              do not check for 'Change-Id' line --patch                    treat FILE as patchfile (default) --emacs                    emacs compile window format --terse                    one line per report

scripts/checkpatch.pl +1 -0
@@ -136,6 +138,7 @@ GetOptions(
  	'q|quiet+'	=> \$quiet,
  	'tree!'		=> \$tree,
  	'signoff!'	=> \$chk_signoff,
+	'changeid!'	=> \$chk_changeid,
  	'patch!'	=> \$chk_patch,
  	'emacs!'	=> \$emacs,
  	'terse!'	=> \$terse,
@@ -2332,7 +2335,7 @@ sub process {
  		}


 # Check for unwanted Gerrit info

scripts/checkpatch.pl +1 -1
-		if ($in_commit_log && $line =~ /^\s*change-id:/i) {
+		if ($in_commit_log && $line =~ /^\s*change-id:/i && $chk_changeid) {

  ERROR("GERRIT_CHANGE_ID",
        "Remove Gerrit Change-Id's before submitting upstream.\n" . $herecurr); }
--
1.9.1