Skip to content

Commit

Permalink
scripts/get_maintainer.pl: use .get_maintainer.conf from . then $HOME…
Browse files Browse the repository at this point in the history
… then scripts

On Mon, 2010-09-13 at 00:01 -0400, [email protected] 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 <[email protected]>
Cc: Valdis Kletnieks <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JoePerches authored and torvalds committed Oct 26, 2010
1 parent e3e9d11 commit bcde44e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions scripts/get_maintainer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@
"blame_commit_pattern" => "^([0-9a-f]+):"
);

if (-f "${lk_path}.get_maintainer.conf") {
my $conf = which_conf(".get_maintainer.conf");
if (-f $conf) {
my @conf_args;
open(my $conffile, '<', "${lk_path}.get_maintainer.conf")
or warn "$P: Can't open .get_maintainer.conf: $!\n";
open(my $conffile, '<', "$conf")
or warn "$P: Can't find a readable .get_maintainer.conf file $!\n";

while (<$conffile>) {
my $line = $_;

Expand Down Expand Up @@ -961,6 +963,18 @@ sub which {
return "";
}

sub which_conf {
my ($conf) = @_;

foreach my $path (split(/:/, ".:$ENV{HOME}:.scripts")) {
if (-e "$path/$conf") {
return "$path/$conf";
}
}

return "";
}

sub mailmap {
my (@lines) = @_;
my %hash;
Expand Down

0 comments on commit bcde44e

Please sign in to comment.