scripts/get_maintainer.pl: add --pattern-depth
authorJoe Perches <joe@perches.com>
Tue, 22 Sep 2009 00:04:17 +0000 (17:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Sep 2009 14:17:46 +0000 (07:17 -0700)
commit3fb55652b9f754990e286723f209ce3c07c96d69
tree6578fa841ae3207a3bb88d2d2c40356f53d637a6
parent1d606b4e0bf8fe45e3f88543dfce83207ae0027d
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>
scripts/get_maintainer.pl