* [PATCH] checkpatch: do not try to sanity test cover letters
@ 2012-02-28 0:29 Paul Gortmaker
2012-02-28 0:36 ` Joe Perches
0 siblings, 1 reply; 5+ messages in thread
From: Paul Gortmaker @ 2012-02-28 0:29 UTC (permalink / raw)
To: apw; +Cc: akpm, joe, linux-kernel, Paul Gortmaker
One possibly common workflow is this:
git format-patch -o mypatches --cover-letter ^start end
./scripts/checkpatch.pl mypatches/*
The problem with the above is that checkpatch.pl will try to
parse the cover-letter, and of course complain that it can not
find any unified diff within.
It is pretty safe for us to assume "0000-cover-letter.patch" is
not in fact a patch and simply skip processing of it.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
[what I know about perl could be written on the back of a postage
stamp in crayon, so please feel free to reimplement the overall
concept of this change as you see fit.... ]
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a3b9782..fc22f4b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6,6 +6,7 @@
# Licensed under the terms of the GNU GPL License version 2
use strict;
+use File::Basename;
my $P = $0;
$P =~ s@.*/@@g;
@@ -382,6 +383,10 @@ for my $filename (@ARGV) {
open($FILE, '<', "$filename") ||
die "$P: $filename: open failed - $!\n";
}
+ if (basename($filename) eq '0000-cover-letter.patch') {
+ print "Skipping cover letter $filename\n";
+ next;
+ }
if ($filename eq '-') {
$vname = 'Your patch';
} else {
--
1.7.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] checkpatch: do not try to sanity test cover letters
2012-02-28 0:29 [PATCH] checkpatch: do not try to sanity test cover letters Paul Gortmaker
@ 2012-02-28 0:36 ` Joe Perches
2012-02-28 0:47 ` Paul Gortmaker
0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2012-02-28 0:36 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: apw, akpm, linux-kernel
On Mon, 2012-02-27 at 19:29 -0500, Paul Gortmaker wrote:
> One possibly common workflow is this:
>
> git format-patch -o mypatches --cover-letter ^start end
> ./scripts/checkpatch.pl mypatches/*
I use a script for this and don't put the check
in checkpatch but put the check in bash.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] checkpatch: do not try to sanity test cover letters
2012-02-28 0:36 ` Joe Perches
@ 2012-02-28 0:47 ` Paul Gortmaker
2012-02-28 0:50 ` Joe Perches
0 siblings, 1 reply; 5+ messages in thread
From: Paul Gortmaker @ 2012-02-28 0:47 UTC (permalink / raw)
To: Joe Perches; +Cc: apw, akpm, linux-kernel
On Mon, Feb 27, 2012 at 7:36 PM, Joe Perches <joe@perches.com> wrote:
> On Mon, 2012-02-27 at 19:29 -0500, Paul Gortmaker wrote:
>> One possibly common workflow is this:
>>
>> git format-patch -o mypatches --cover-letter ^start end
>> ./scripts/checkpatch.pl mypatches/*
>
> I use a script for this and don't put the check
> in checkpatch but put the check in bash.
Sure, and I can do the same. But my question to you is whether
you think the above is a common workflow, and if the false positives
that it generates will decrease the number of people likely to make
using it a part of their routine?
Paul.
--
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] checkpatch: do not try to sanity test cover letters
2012-02-28 0:47 ` Paul Gortmaker
@ 2012-02-28 0:50 ` Joe Perches
2012-02-28 15:38 ` Andy Whitcroft
0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2012-02-28 0:50 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: apw, akpm, linux-kernel
On Mon, 2012-02-27 at 19:47 -0500, Paul Gortmaker wrote:
> On Mon, Feb 27, 2012 at 7:36 PM, Joe Perches <joe@perches.com> wrote:
> > On Mon, 2012-02-27 at 19:29 -0500, Paul Gortmaker wrote:
> >> One possibly common workflow is this:
> >>
> >> git format-patch -o mypatches --cover-letter ^start end
> >> ./scripts/checkpatch.pl mypatches/*
> >
> > I use a script for this and don't put the check
> > in checkpatch but put the check in bash.
>
> Sure, and I can do the same. But my question to you is whether
> you think the above is a common workflow, and if the false positives
> that it generates will decrease the number of people likely to make
> using it a part of their routine?
Dunno. I generally think that tools should report
errors when the input given them is inappropriate.
cheers, Joe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] checkpatch: do not try to sanity test cover letters
2012-02-28 0:50 ` Joe Perches
@ 2012-02-28 15:38 ` Andy Whitcroft
0 siblings, 0 replies; 5+ messages in thread
From: Andy Whitcroft @ 2012-02-28 15:38 UTC (permalink / raw)
To: Joe Perches; +Cc: Paul Gortmaker, akpm, linux-kernel
On Mon, Feb 27, 2012 at 04:50:11PM -0800, Joe Perches wrote:
> On Mon, 2012-02-27 at 19:47 -0500, Paul Gortmaker wrote:
> > On Mon, Feb 27, 2012 at 7:36 PM, Joe Perches <joe@perches.com> wrote:
> > > On Mon, 2012-02-27 at 19:29 -0500, Paul Gortmaker wrote:
> > >> One possibly common workflow is this:
> > >>
> > >> git format-patch -o mypatches --cover-letter ^start end
> > >> ./scripts/checkpatch.pl mypatches/*
> > >
> > > I use a script for this and don't put the check
> > > in checkpatch but put the check in bash.
> >
> > Sure, and I can do the same. But my question to you is whether
> > you think the above is a common workflow, and if the false positives
> > that it generates will decrease the number of people likely to make
> > using it a part of their routine?
>
> Dunno. I generally think that tools should report
> errors when the input given them is inappropriate.
Tend to agree, the more complex we make checkpatch the more often it
will be wrong. And it is wrong enough already.
-apw
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-28 15:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-28 0:29 [PATCH] checkpatch: do not try to sanity test cover letters Paul Gortmaker
2012-02-28 0:36 ` Joe Perches
2012-02-28 0:47 ` Paul Gortmaker
2012-02-28 0:50 ` Joe Perches
2012-02-28 15:38 ` Andy Whitcroft
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).