Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1346872 > unrolled thread

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

Started by"Pottratz, Dwane" <dwane.pottratz@intel.com>
First post2016-03-01 19:40 +0100
Last post2016-03-02 20:20 +0100
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] checkpatch.pl: add switch to turn off check for Change-Id "Pottratz, Dwane" <dwane.pottratz@intel.com> - 2016-03-01 19:40 +0100
    Re: [PATCH] checkpatch.pl: add switch to turn off check for  Change-Id Joe Perches <joe@perches.com> - 2016-03-01 22:50 +0100
      Re: [PATCH] checkpatch.pl: add switch to turn off check for  Change-Id Joe Perches <joe@perches.com> - 2016-03-02 00:30 +0100
        RE: [PATCH] checkpatch.pl: add switch to turn off check for  Change-Id "Pottratz, Dwane" <dwane.pottratz@intel.com> - 2016-03-02 20:20 +0100
          Re: [PATCH] checkpatch.pl: add switch to turn off check for  Change-Id Joe Perches <joe@perches.com> - 2016-03-02 20:20 +0100

#1346872 — [PATCH] checkpatch.pl: add switch to turn off check for Change-Id

From"Pottratz, Dwane" <dwane.pottratz@intel.com>
Date2016-03-01 19:40 +0100
Subject[PATCH] checkpatch.pl: add switch to turn off check for Change-Id
Message-ID<r7Xnd-4qM-47@gated-at.bofh.it>
A commit hook for the Gerrit code review servers inserts change
identifiers.  These identifiers are noise in the context of the
upstream kernel.  However, they are needed in most development
environments and the error needs to be ignored for static analysis
tools.

Signed-off-by: Dwane Pottratz <dwane.pottratz@intel.com>
---
 scripts/checkpatch.pl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2b3c228..0756935 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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,
@@ -2310,7 +2313,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

[toc] | [next] | [standalone]


#1347050 — Re: [PATCH] checkpatch.pl: add switch to turn off check for Change-Id

FromJoe Perches <joe@perches.com>
Date2016-03-01 22:50 +0100
SubjectRe: [PATCH] checkpatch.pl: add switch to turn off check for Change-Id
Message-ID<r80l4-6wz-13@gated-at.bofh.it>
In reply to#1346872
On Tue, 2016-03-01 at 18:37 +0000, Pottratz, Dwane wrote:
> A commit hook for the Gerrit code review servers inserts change
> identifiers.  These identifiers are noise in the context of the
> upstream kernel.  However, they are needed in most development
> environments and the error needs to be ignored for static analysis
> tools.

btw: another way to do this is to use the --ignore <foo-list> option.

$ ./scripts/checkpatch.pl --ignore gerrit_change_id <patch>

[toc] | [prev] | [next] | [standalone]


#1347101 — Re: [PATCH] checkpatch.pl: add switch to turn off check for Change-Id

FromJoe Perches <joe@perches.com>
Date2016-03-02 00:30 +0100
SubjectRe: [PATCH] checkpatch.pl: add switch to turn off check for Change-Id
Message-ID<r81TQ-7Bj-35@gated-at.bofh.it>
In reply to#1347050
On Tue, 2016-03-01 at 21:49 +0000, Pottratz, Dwane wrote:
> Good to know.  Thx. 

Andrew picked this up, but it might be better to remove your
patch and just use the --ignore option as --ignore is generic
and your patch just duplicates the capability.


> 
> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com] 
> Sent: Tuesday, March 1, 2016 1:41 PM
> To: Pottratz, Dwane <dwane.pottratz@intel.com>; apw@canonical.com; li
> nux-kernel@vger.kernel.org; 'akpm@linux-foundation.org' <akpm@linux-f
> oundation.org>
> Subject: Re: [PATCH] checkpatch.pl: add switch to turn off check for
> Change-Id
> 
> On Tue, 2016-03-01 at 18:37 +0000, Pottratz, Dwane wrote:
> > 
> > A commit hook for the Gerrit code review servers inserts change 
> > identifiers.  These identifiers are noise in the context of the 
> > upstream kernel.  However, they are needed in most development 
> > environments and the error needs to be ignored for static analysis 
> > tools.
> btw: another way to do this is to use the --ignore <foo-list> option.
> 
> $ ./scripts/checkpatch.pl --ignore gerrit_change_id <patch>
> 

[toc] | [prev] | [next] | [standalone]


#1348415 — RE: [PATCH] checkpatch.pl: add switch to turn off check for Change-Id

From"Pottratz, Dwane" <dwane.pottratz@intel.com>
Date2016-03-02 20:20 +0100
SubjectRE: [PATCH] checkpatch.pl: add switch to turn off check for Change-Id
Message-ID<r8kts-41q-9@gated-at.bofh.it>
In reply to#1347101
Hi Joe,

Locally I will remove the patch and use the '--ignore' option.  

Is there anything I need to do for upstream?  (Sorry, I am new to submitting patches upstream)

-Dwane

-----Original Message-----
From: Joe Perches [mailto:joe@perches.com] 
Sent: Tuesday, March 1, 2016 3:22 PM
To: Pottratz, Dwane <dwane.pottratz@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>; LKML <linux-kernel@vger.kernel.org>; Andy Whitcroft <apw@canonical.com>
Subject: Re: [PATCH] checkpatch.pl: add switch to turn off check for Change-Id

On Tue, 2016-03-01 at 21:49 +0000, Pottratz, Dwane wrote:
> Good to know.  Thx.

Andrew picked this up, but it might be better to remove your patch and just use the --ignore option as --ignore is generic and your patch just duplicates the capability.


> 
> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Tuesday, March 1, 2016 1:41 PM
> To: Pottratz, Dwane <dwane.pottratz@intel.com>; apw@canonical.com; li 
> nux-kernel@vger.kernel.org; 'akpm@linux-foundation.org' <akpm@linux-f 
> oundation.org>
> Subject: Re: [PATCH] checkpatch.pl: add switch to turn off check for 
> Change-Id
> 
> On Tue, 2016-03-01 at 18:37 +0000, Pottratz, Dwane wrote:
> > 
> > A commit hook for the Gerrit code review servers inserts change 
> > identifiers.  These identifiers are noise in the context of the 
> > upstream kernel.  However, they are needed in most development 
> > environments and the error needs to be ignored for static analysis 
> > tools.
> btw: another way to do this is to use the --ignore <foo-list> option.
> 
> $ ./scripts/checkpatch.pl --ignore gerrit_change_id <patch>
> 

[toc] | [prev] | [next] | [standalone]


#1348417 — Re: [PATCH] checkpatch.pl: add switch to turn off check for Change-Id

FromJoe Perches <joe@perches.com>
Date2016-03-02 20:20 +0100
SubjectRe: [PATCH] checkpatch.pl: add switch to turn off check for Change-Id
Message-ID<r8kts-41q-13@gated-at.bofh.it>
In reply to#1348415
On Wed, 2016-03-02 at 19:15 +0000, Pottratz, Dwane wrote:
> Hi Joe,

Hello again Dwane.

> Locally I will remove the patch and use the '--ignore' option.  

That's good, thanks.

> Is there anything I need to do for upstream?

No, I think it's fine as-is.

Thanks for the patch, it was fine, but it duplicated
existing functionality.  It just took me a bit to
recognize the duplication.

> (Sorry, I am new to submitting patches upstream)

No worries, and 'welcome'.

cheers, Joe

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web