diff options
author | Joe Perches <joe@perches.com> | 2011-01-12 19:59:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 11:03:10 -0500 |
commit | ab6c937dbadf4797484d00d2815e1e3b0ec54397 (patch) | |
tree | 3f1035e2344e859f111ee83b6792f95a97ea01ce /scripts/get_maintainer.pl | |
parent | 7e1863af1636b304a5f59aab6fb78d38e4079875 (diff) |
scripts/get_maintainer.pl: use --git-fallback more often
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/get_maintainer.pl')
-rwxr-xr-x | 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 43bace2f4ac8..139e0fff8e31 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -494,6 +494,40 @@ if ($web) { | |||
494 | 494 | ||
495 | exit($exit); | 495 | exit($exit); |
496 | 496 | ||
497 | sub range_is_maintained { | ||
498 | my ($start, $end) = @_; | ||
499 | |||
500 | for (my $i = $start; $i < $end; $i++) { | ||
501 | my $line = $typevalue[$i]; | ||
502 | if ($line =~ m/^(\C):\s*(.*)/) { | ||
503 | my $type = $1; | ||
504 | my $value = $2; | ||
505 | if ($type eq 'S') { | ||
506 | if ($value =~ /(maintain|support)/i) { | ||
507 | return 1; | ||
508 | } | ||
509 | } | ||
510 | } | ||
511 | } | ||
512 | return 0; | ||
513 | } | ||
514 | |||
515 | sub range_has_maintainer { | ||
516 | my ($start, $end) = @_; | ||
517 | |||
518 | for (my $i = $start; $i < $end; $i++) { | ||
519 | my $line = $typevalue[$i]; | ||
520 | if ($line =~ m/^(\C):\s*(.*)/) { | ||
521 | my $type = $1; | ||
522 | my $value = $2; | ||
523 | if ($type eq 'M') { | ||
524 | return 1; | ||
525 | } | ||
526 | } | ||
527 | } | ||
528 | return 0; | ||
529 | } | ||
530 | |||
497 | sub get_maintainers { | 531 | sub get_maintainers { |
498 | %email_hash_name = (); | 532 | %email_hash_name = (); |
499 | %email_hash_address = (); | 533 | %email_hash_address = (); |
@@ -556,7 +590,9 @@ sub get_maintainers { | |||
556 | my $file_pd = ($file =~ tr@/@@); | 590 | my $file_pd = ($file =~ tr@/@@); |
557 | $value_pd++ if (substr($value,-1,1) ne "/"); | 591 | $value_pd++ if (substr($value,-1,1) ne "/"); |
558 | $value_pd = -1 if ($value =~ /^\.\*/); | 592 | $value_pd = -1 if ($value =~ /^\.\*/); |
559 | if ($value_pd >= $file_pd) { | 593 | if ($value_pd >= $file_pd && |
594 | range_is_maintained($start, $end) && | ||
595 | range_has_maintainer($start, $end)) { | ||
560 | $exact_pattern_match_hash{$file} = 1; | 596 | $exact_pattern_match_hash{$file} = 1; |
561 | } | 597 | } |
562 | if ($pattern_depth == 0 || | 598 | if ($pattern_depth == 0 || |