mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scripts/get_maintainer.pl:  Use --git-fallback more often
       [not found]         ` <20101105135038.7ea63465.akpm@linux-foundation.org>
@ 2010-11-06 12:28           ` Joe Perches
  0 siblings, 0 replies; only message in thread
From: Joe Perches @ 2010-11-06 12:28 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

On Fri, 2010-11-05 at 13:50 -0700, Andrew Morton wrote:
> z:/usr/src/git26> perl scripts/get_maintainer.pl -file mm/mempolicy.c  
> linux-mm@kvack.org
> linux-kernel@vger.kernel.org

Turns out this is an arguable defect in the script.

The MAINTAINERS entry for mm is:

MEMORY MANAGEMENT
L:	linux-mm@kvack.org
W:	http://www.linux-mm.org
S:	Maintained
F:	include/linux/mm.h
F:	mm/

There's a maintainer entry, but no named individual, so
the script doesn't use git history via --git-fallback.

This is also a defect for MAINTAINERS with status
entries marked "Orphan" or "Odd fixes".

The script now checks a section for any "M:" entry and
that an "S:" entry is supported or maintained.  If both
those conditions are not satisified, use --git-fallback
as appropriate.

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/get_maintainer.pl |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 43bace2..139e0ff 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -494,6 +494,40 @@ if ($web) {
 
 exit($exit);
 
+sub range_is_maintained {
+    my ($start, $end) = @_;
+
+    for (my $i = $start; $i < $end; $i++) {
+	my $line = $typevalue[$i];
+	if ($line =~ m/^(\C):\s*(.*)/) {
+	    my $type = $1;
+	    my $value = $2;
+	    if ($type eq 'S') {
+		if ($value =~ /(maintain|support)/i) {
+		    return 1;
+		}
+	    }
+	}
+    }
+    return 0;
+}
+
+sub range_has_maintainer {
+    my ($start, $end) = @_;
+
+    for (my $i = $start; $i < $end; $i++) {
+	my $line = $typevalue[$i];
+	if ($line =~ m/^(\C):\s*(.*)/) {
+	    my $type = $1;
+	    my $value = $2;
+	    if ($type eq 'M') {
+		return 1;
+	    }
+	}
+    }
+    return 0;
+}
+
 sub get_maintainers {
     %email_hash_name = ();
     %email_hash_address = ();
@@ -556,7 +590,9 @@ sub get_maintainers {
 				my $file_pd = ($file  =~ tr@/@@);
 				$value_pd++ if (substr($value,-1,1) ne "/");
 				$value_pd = -1 if ($value =~ /^\.\*/);
-				if ($value_pd >= $file_pd) {
+				if ($value_pd >= $file_pd &&
+				    range_is_maintained($start, $end) &&
+				    range_has_maintainer($start, $end)) {
 				    $exact_pattern_match_hash{$file} = 1;
 				}
 				if ($pattern_depth == 0 ||



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-06 12:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <201010262122.o9QLMwpM016799@imap1.linux-foundation.org>
     [not found] ` <1288133540.4145.37.camel@Joe-Laptop>
     [not found]   ` <1288987842.19564.1.camel@Joe-Laptop>
     [not found]     ` <20101105131817.b794b123.akpm@linux-foundation.org>
     [not found]       ` <1288989274.19564.4.camel@Joe-Laptop>
     [not found]         ` <20101105135038.7ea63465.akpm@linux-foundation.org>
2010-11-06 12:28           ` [PATCH] scripts/get_maintainer.pl: Use --git-fallback more often Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®