lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <19c54ca5b3750bebc057e20542ad6c0c2acef960.camel@perches.com>
Date:   Tue, 08 Oct 2019 08:20:53 -0700
From:   Joe Perches <joe@...ches.com>
To:     Geert Uytterhoeven <geert+renesas@...der.be>,
        Andy Whitcroft <apw@...onical.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch: use patch subject when reading from stdin

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*(.*)/);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ