linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch: use patch subject when reading from stdin
@ 2019-10-08  9:40 Geert Uytterhoeven
  2019-10-08 12:50 ` Joe Perches
  2019-10-08 15:20 ` Joe Perches
  0 siblings, 2 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2019-10-08  9:40 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: linux-kernel, Geert Uytterhoeven

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.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.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;
+		}
 		push(@rawlines, $_);
 	}
 	close($FILE);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-10-16  6:57 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08  9:40 [PATCH] checkpatch: use patch subject when reading from stdin Geert Uytterhoeven
2019-10-08 12:50 ` Joe Perches
2019-10-08 12:59   ` Geert Uytterhoeven
2019-10-08 15:20 ` Joe Perches
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

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).