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 <[email protected]>
M:	Simon Horman <[email protected]>
M:	Julian Anastasov <[email protected]>
[...]
F:	net/netfilter/ipvs/

NETFILTER/IPTABLES/IPCHAINS
[...]
M:	Patrick McHardy <[email protected]>
[...]
F:	net/netfilter/

NETWORKING [GENERAL]
M:	"David S. Miller" <[email protected]>
[...]
F:	net/

THE REST
M:	Linus Torvalds <[email protected]>
[...]
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 <[email protected]>
Simon Horman <[email protected]>
Wensong Zhang <[email protected]>
Patrick McHardy <[email protected]>
David S. Miller <[email protected]>

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 <[email protected]>
Simon Horman <[email protected]>
Wensong Zhang <[email protected]>

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 <[email protected]>
Simon Horman <[email protected]>
Wensong Zhang <[email protected]>
Patrick McHardy <[email protected]>

and so on.

Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
1 file changed