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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1410806637-3510-1-git-send-email-fabf@skynet.be>
Date:	Mon, 15 Sep 2014 20:43:57 +0200
From:	Fabian Frederick <fabf@...net.be>
To:	linux-kernel@...r.kernel.org
Cc:	Fabian Frederick <fabf@...net.be>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Joe Perches <joe@...ches.com>
Subject: [PATCH 1/1] checkpatch: check for subject uniqueness in git repository.

Adding patch subject uniqueness check in checkpatch --strict mode.
See Documentation/SubmittingPatches/globally-unique identifier.

Inspired-by: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Joe Perches <joe@...ches.com>
Signed-off-by: Fabian Frederick <fabf@...net.be>
---
 scripts/checkpatch.pl | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0c520f7..2be06c9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1810,6 +1810,7 @@ sub process {
 
 	our $clean = 1;
 	my $signoff = 0;
+	my $git_samesubjects = 0;
 	my $is_patch = 0;
 
 	my $in_header_lines = $file ? 0 : 1;
@@ -2047,6 +2048,15 @@ sub process {
 			}
 		}
 
+# Check patch subject on subjective/strict check mode
+		if ($check && $line =~ /^Subject: \[(.*)\](.*)/) {
+			my $subject = $2;
+			if ($quiet == 0) {
+				print "Looking for patches with the same subject in git repository ...\n";
+			}
+			$git_samesubjects = `git log --oneline | grep -m1 "$subject\$" | wc  -l`;
+		}
+
 # Check the patch for a signoff:
 		if ($line =~ /^\s*signed-off-by:/i) {
 			$signoff++;
@@ -5091,6 +5101,10 @@ sub process {
 		ERROR("MISSING_SIGN_OFF",
 		      "Missing Signed-off-by: line(s)\n");
 	}
+	if ($is_patch && $git_samesubjects > 0)  {
+		WARN("NOT_UNIQUE_SUBJECT",
+		     "similar subjects found in git repository\n");
+	}
 
 	print report_dump();
 	if ($summary && !($clean == 1 && $quiet == 1)) {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ