[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191008094006.8251-1-geert+renesas@glider.be>
Date: Tue, 8 Oct 2019 11:40:06 +0200
From: Geert Uytterhoeven <geert+renesas@...der.be>
To: Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>
Cc: linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH] checkpatch: use patch subject when reading from stdin
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@...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;
+ }
push(@rawlines, $_);
}
close($FILE);
--
2.17.1
Powered by blists - more mailing lists