lkml.org 
[lkml]   [2014]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] checkpatch: check for subject uniqueness in git repository.
Date
Adding patch subject uniqueness check in checkpatch --strict mode.
See Documentation/SubmittingPatches/globally-unique identifier.

Inspired-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Fabian Frederick <fabf@skynet.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


\
 
 \ /
  Last update: 2014-09-15 21:21    [W:0.096 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site