Skip to content

Commit bcde44e

Browse files
JoePerchestorvalds
authored andcommitted
scripts/get_maintainer.pl: use .get_maintainer.conf from . then $HOME then scripts
On Mon, 2010-09-13 at 00:01 -0400, Valdis.Kletnieks@vt.edu wrote: > Any chance of getting that to be ~/.get_maintainer.conf rather than > ./.get_maintainer.conf? I've just gotten bit like the 3rd or 4th time by > "oh but you didn't create that file in *this* tree" > (I usually have a linus git tree, a linux-next tree, and 3-4 -mm trees) Sure. Add a search path for the .conf file. 3 paths are added: . customized per-tree configurations $HOME user global configuration when per-tree configs don't exist ./scripts lk defaults to override script Signed-off-by: Joe Perches <joe@perches.com> Cc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent e3e9d11 commit bcde44e

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

‎scripts/get_maintainer.pl‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,12 @@
110110
"blame_commit_pattern" => "^([0-9a-f]+):"
111111
);
112112

113-
if (-f "${lk_path}.get_maintainer.conf") {
113+
my $conf = which_conf(".get_maintainer.conf");
114+
if (-f $conf) {
114115
my @conf_args;
115-
open(my $conffile, '<', "${lk_path}.get_maintainer.conf")
116-
or warn "$P: Can't open .get_maintainer.conf: $!\n";
116+
open(my $conffile, '<', "$conf")
117+
or warn "$P: Can't find a readable .get_maintainer.conf file $!\n";
118+
117119
while (<$conffile>) {
118120
my $line = $_;
119121

@@ -961,6 +963,18 @@ sub which {
961963
return "";
962964
}
963965

966+
sub which_conf {
967+
my ($conf) = @_;
968+
969+
foreach my $path (split(/:/, ".:$ENV{HOME}:.scripts")) {
970+
if (-e "$path/$conf") {
971+
return "$path/$conf";
972+
}
973+
}
974+
975+
return "";
976+
}
977+
964978
sub mailmap {
965979
my (@lines) = @_;
966980
my %hash;

0 commit comments

Comments
 (0)