• Joe Perches's avatar
    scripts/get_maintainer.pl: add --pattern-depth · 3fb55652
    Joe Perches authored
    --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: default avatarJoe Perches <joe@perches.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    3fb55652
get_maintainer.pl 18.9 KB