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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue,  5 May 2020 15:26:13 +0200
From:   Geert Uytterhoeven <>
To:     Andy Whitcroft <>, Joe Perches <>
Cc:     Konstantin Ryabitsev <>,
        Andrew Morton <>,,,
        Geert Uytterhoeven <>
Subject: [PATCH v2] checkpatch: use patch subject when reading from stdin

While "git am" can apply an mbox file containing multiple patches (e.g.
as created by b4[1], or a patch bundle downloaded from patchwork),
checkpatch does not have proper support for that.  When operating on an
mbox, checkpatch will merge all detected tags, and complain falsely
about duplicates:

    WARNING: Duplicate signature

As modifying checkpatch to reset state in between each patch is a lot of
work, a simple solution is splitting the mbox into individual patches,
and invoking checkpatch for each of them.  Fortunately checkpatch can read
a patch from stdin, so the classic "formail" tool can be used to split
the mbox, and pipe all individual patches to checkpatch:

    formail -s scripts/ < my-mbox

However, 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.


    Your patch has no obvious style problems and is ready for submission.

Hence it can be difficult to identify which patches need to be reviewed
and improved.

Fix this by replacing "Your patch" by (the first line of) the email
subject, if present.

Note that "git mailsplit" can also be used to split an mbox, but it will
create individual files for each patch, thus requiring cleanup
afterwards.  Formail does not have this disadvantage.


Signed-off-by: Geert Uytterhoeven <>
  - Add more rationale,
  - Refer to the new b4 tool.
 scripts/ | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/ b/scripts/
index eac40f0abd56a9f4..3355358697d9e790 100755
--- a/scripts/
+++ b/scripts/
@@ -1057,6 +1057,10 @@ for my $filename (@ARGV) {
 	while (<$FILE>) {
+		if ($vname eq 'Your patch') {
+			my ($subject) = $_ =~ /^Subject:\s*(.*)/;
+			$vname = '"' . $subject . '"' if $subject;
+		}
 		push(@rawlines, $_);

Powered by blists - more mailing lists