• Joe Perches's avatar
    scripts/get_maintainer.pl: add sections in pattern match depth order · 1d606b4e
    Joe Perches authored
    Before this change, matched sections were added in the order
    of appearance in the normally alphabetic section order of
    the MAINTAINERS file.
    
    For instance, finding the maintainer for drivers/scsi/wd7000.c
    would first find "SCSI SUBSYSTEM", then "WD7000 SCSI SUBSYSTEM",
    then "THE REST".
    
    before patch:
    
    $ ./scripts/get_maintainer.pl --nogit -f drivers/scsi/wd7000.c
    James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
    Miroslav Zagorac <zaga@fly.cc.fer.hr>
    linux-scsi@vger.kernel.org
    linux-kernel@vger.kernel.org
    
    get_maintainer.pl now selects matched sections by longest pattern match.
    Longest is the number of "/"s and any specific file pattern.
    
    This changes the example output order of MAINTAINERS to whatever is
    selected in "WD7000 SUBSYSTEM", then "SCSI SYSTEM", then "THE REST".
    
    after patch:
    
    $ ./scripts/get_maintainer.pl --nogit -f drivers/scsi/wd7000.c
    Miroslav Zagorac <zaga@fly.cc.fer.hr>
    James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
    linux-scsi@vger.kernel.org
    linux-kernel@vger.kernel.org
    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>
    1d606b4e
get_maintainer.pl 18.7 KB