diff options
author | Joe Perches <joe@perches.com> | 2009-09-21 20:04:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:46 -0400 |
commit | 3fb55652b9f754990e286723f209ce3c07c96d69 (patch) | |
tree | 6578fa841ae3207a3bb88d2d2c40356f53d637a6 /scripts | |
parent | 1d606b4e0bf8fe45e3f88543dfce83207ae0027d (diff) |
scripts/get_maintainer.pl: add --pattern-depth
--pattern-depth is used to control how many levels of directory traversal
should be performed to find maintainers. default is 0 (all directory levels).
For instance:
MAINTAINERS currently has multiple M: and F: entries that match
net/netfilter/ipvs/ip_vs_app.c
IPVS
M: Wensong Zhang <wensong@linux-vs.org>
M: Simon Horman <horms@verge.net.au>
M: Julian Anastasov <ja@ssi.bg>
[...]
F: net/netfilter/ipvs/
NETFILTER/IPTABLES/IPCHAINS
[...]
M: Patrick McHardy <kaber@trash.net>
[...]
F: net/netfilter/
NETWORKING [GENERAL]
M: "David S. Miller" <davem@davemloft.net>
[...]
F: net/
THE REST
M: Linus Torvalds <torvalds@linux-foundation.org>
[...]
F: */
Using this command will return all of those maintainers:
(except Linus unless --git-chief-maintainers is specified)
$ ./scripts/get_maintainer.pl --nogit -nol \
-f net/netfilter/ipvs/ip_vs_app.c
Julian Anastasov <ja@ssi.bg>
Simon Horman <horms@verge.net.au>
Wensong Zhang <wensong@linux-vs.org>
Patrick McHardy <kaber@trash.net>
David S. Miller <davem@davemloft.net>
Adding --pattern-depth=1 will match at the deepest level
$ ./scripts/get_maintainer.pl --nogit -nol --pattern-depth=1 \
-f net/netfilter/ipvs/ip_vs_app.c
Julian Anastasov <ja@ssi.bg>
Simon Horman <horms@verge.net.au>
Wensong Zhang <wensong@linux-vs.org>
Adding --pattern-depth=2 will match at the deepest level and 1 higher
$ ./scripts/get_maintainer.pl --nogit -nol --pattern-depth=2 \
-f net/netfilter/ipvs/ip_vs_app.c
Julian Anastasov <ja@ssi.bg>
Simon Horman <horms@verge.net.au>
Wensong Zhang <wensong@linux-vs.org>
Patrick McHardy <kaber@trash.net>
and so on.
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')
-rwxr-xr-x | scripts/get_maintainer.pl | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index fb446e0f8bbf..5132949500c1 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -13,7 +13,7 @@ | |||
13 | use strict; | 13 | use strict; |
14 | 14 | ||
15 | my $P = $0; | 15 | my $P = $0; |
16 | my $V = '0.18beta2'; | 16 | my $V = '0.19'; |
17 | 17 | ||
18 | use Getopt::Long qw(:config no_auto_abbrev); | 18 | use Getopt::Long qw(:config no_auto_abbrev); |
19 | 19 | ||
@@ -37,6 +37,7 @@ my $web = 0; | |||
37 | my $subsystem = 0; | 37 | my $subsystem = 0; |
38 | my $status = 0; | 38 | my $status = 0; |
39 | my $from_filename = 0; | 39 | my $from_filename = 0; |
40 | my $pattern_depth = 0; | ||
40 | my $version = 0; | 41 | my $version = 0; |
41 | my $help = 0; | 42 | my $help = 0; |
42 | 43 | ||
@@ -80,6 +81,7 @@ if (!GetOptions( | |||
80 | 'status!' => \$status, | 81 | 'status!' => \$status, |
81 | 'scm!' => \$scm, | 82 | 'scm!' => \$scm, |
82 | 'web!' => \$web, | 83 | 'web!' => \$web, |
84 | 'pattern-depth=i' => \$pattern_depth, | ||
83 | 'f|file' => \$from_filename, | 85 | 'f|file' => \$from_filename, |
84 | 'v|version' => \$version, | 86 | 'v|version' => \$version, |
85 | 'h|help' => \$help, | 87 | 'h|help' => \$help, |
@@ -226,9 +228,13 @@ foreach my $file (@files) { | |||
226 | my $value = $2; | 228 | my $value = $2; |
227 | if ($type eq 'F') { | 229 | if ($type eq 'F') { |
228 | if (file_match_pattern($file, $value)) { | 230 | if (file_match_pattern($file, $value)) { |
229 | my $pattern_depth = ($value =~ tr@/@@); | 231 | my $value_pd = ($value =~ tr@/@@); |
230 | $pattern_depth++ if (!(substr($value,-1,1) eq "/")); | 232 | my $file_pd = ($file =~ tr@/@@); |
231 | $hash{$tvi} = $pattern_depth; | 233 | $value_pd++ if (substr($value,-1,1) ne "/"); |
234 | if ($pattern_depth == 0 || | ||
235 | (($file_pd - $value_pd) < $pattern_depth)) { | ||
236 | $hash{$tvi} = $value_pd; | ||
237 | } | ||
232 | } | 238 | } |
233 | } | 239 | } |
234 | } | 240 | } |
@@ -345,13 +351,14 @@ Output type options: | |||
345 | --separator [, ] => separator for multiple entries on 1 line | 351 | --separator [, ] => separator for multiple entries on 1 line |
346 | --multiline => print 1 entry per line | 352 | --multiline => print 1 entry per line |
347 | 353 | ||
348 | Default options: | ||
349 | [--email --git --m --n --l --multiline] | ||
350 | |||
351 | Other options: | 354 | Other options: |
355 | --pattern-depth => Number of pattern directory traversals (default: 0 (all)) | ||
352 | --version => show version | 356 | --version => show version |
353 | --help => show this help information | 357 | --help => show this help information |
354 | 358 | ||
359 | Default options: | ||
360 | [--email --git --m --n --l --multiline --pattern-depth=0] | ||
361 | |||
355 | Notes: | 362 | Notes: |
356 | Using "-f directory" may give unexpected results: | 363 | Using "-f directory" may give unexpected results: |
357 | Used with "--git", git signators for _all_ files in and below | 364 | Used with "--git", git signators for _all_ files in and below |