[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdW=qamydEn6=cEbeRe79jBi4FZ8LH+3OyTQp0S-w7+3WQ@mail.gmail.com>
Date: Tue, 8 Oct 2019 14:59:15 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Joe Perches <joe@...ches.com>
Cc: Geert Uytterhoeven <geert+renesas@...der.be>,
Andy Whitcroft <apw@...onical.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] checkpatch: use patch subject when reading from stdin
Hi Joe,
On Tue, Oct 8, 2019 at 2:50 PM Joe Perches <joe@...ches.com> wrote:
> On Tue, 2019-10-08 at 11:40 +0200, Geert Uytterhoeven wrote:
> > When reading a patch file from standard input, checkpatch calls it "Your
> > patch", and reports its state as:
> >
> > Your patch has style problems, please review.
> >
> > or:
> >
> > Your patch has no obvious style problems and is ready for submission.
> >
> > Hence when checking multiple patches by piping them to checkpatch, e.g.
> > when checking patchwork bundles using:
> >
> > formail -s scripts/checkpatch.pl < bundle-foo.mbox
> >
> > it is difficult to identify which patches need to be reviewed and
> > improved.
> >
> > Fix this by replacing "Your patch" by the patch subject, if present.
>
> Seems sensible, thanks Geert
>
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
> > ---
> > scripts/checkpatch.pl | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 6fcc66afb0880830..6b9feb4d646a116b 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -1047,6 +1047,10 @@ for my $filename (@ARGV) {
> > }
> > while (<$FILE>) {
> > chomp;
> > + if ($vname eq 'Your patch') {
> > + my ($subject) = $_ =~ /^Subject:\s*(.*)/;
> > + $vname = '"' . $subject . '"' if $subject;
>
> trivia:
>
> Not a big deal and is likely good enough but this will
> cut off subjects that are continued on multiple lines.
>
> e.g.:
>
> Subject: [PATCH Vx n/M] very long description with a subject spanning
> multiple lines
> From: patch submitter <submitter@...ain.tld>
I know.
Fixing that is not that simple, I'm afraid.
And $vname is used before process() is called.
>
> > + }
> > push(@rawlines, $_);
> > }
> > close($FILE);
>
--
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists