mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>,
	Andy Whitcroft <apw@canonical.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: use patch subject when reading from stdin
Date: Tue, 08 Oct 2019 08:20:53 -0700	[thread overview]
Message-ID: <19c54ca5b3750bebc057e20542ad6c0c2acef960.camel@perches.com> (raw)
In-Reply-To: <20191008094006.8251-1-geert+renesas@glider.be>

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.
[]
> diff --git 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;

Hi again Geert.

Just some stylistic nits:

$filename is not quoted so I think adding quotes
before and after $subject may not be useful.

Can you please use what checkpatch uses as a more
common parenthesis style after an if?

i.e. use:
	if (foo)
not
	if foo

so maybe:

	if ($filename eq '-' && $_ =~ /^Subject:\s*(.*)/) {
		$vname = $1;
	}

or maybe

	$vname = $1 if ($filename eq '-' && $_ =~ /^Subject:\s*(.*)/);



  parent reply	other threads:[~2019-10-08 15:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08  9:40 Geert Uytterhoeven
2019-10-08 12:50 ` Joe Perches
2019-10-08 12:59   ` Geert Uytterhoeven
2019-10-08 15:20 ` Joe Perches [this message]
2019-10-08 15:28   ` Geert Uytterhoeven
2019-10-08 17:02     ` Joe Perches
2019-10-08 18:10       ` Geert Uytterhoeven
2019-10-08 18:25         ` Joe Perches
2019-10-08 18:39           ` Geert Uytterhoeven
2019-10-08 18:50             ` Joe Perches
2019-10-14  9:20         ` Geert Uytterhoeven
2019-10-14 14:48           ` Joe Perches
2019-10-15  6:49             ` Geert Uytterhoeven
2019-10-15 15:50               ` Joe Perches
2019-10-15 16:40                 ` Geert Uytterhoeven
2019-10-15 17:24                   ` Joe Perches
2019-10-16  6:57                     ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19c54ca5b3750bebc057e20542ad6c0c2acef960.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®