diff options
author | Joe Perches <joe@perches.com> | 2010-10-26 17:22:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 19:52:17 -0400 |
commit | bcde44ed7d2a58733efdf04b5392c027d1348bac (patch) | |
tree | 09ce6f1b82f592364ec86fa380342f39ccefe981 /scripts/get_maintainer.pl | |
parent | e3e9d11479737692f797bad1762f71468d577a93 (diff) |
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>
Diffstat (limited to 'scripts/get_maintainer.pl')
-rwxr-xr-x | scripts/get_maintainer.pl | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index f46576949ccb..e5a400c53bf0 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -110,10 +110,12 @@ my %VCS_cmds_hg = ( | |||
110 | "blame_commit_pattern" => "^([0-9a-f]+):" | 110 | "blame_commit_pattern" => "^([0-9a-f]+):" |
111 | ); | 111 | ); |
112 | 112 | ||
113 | if (-f "${lk_path}.get_maintainer.conf") { | 113 | my $conf = which_conf(".get_maintainer.conf"); |
114 | if (-f $conf) { | ||
114 | my @conf_args; | 115 | my @conf_args; |
115 | open(my $conffile, '<', "${lk_path}.get_maintainer.conf") | 116 | open(my $conffile, '<', "$conf") |
116 | or warn "$P: Can't open .get_maintainer.conf: $!\n"; | 117 | or warn "$P: Can't find a readable .get_maintainer.conf file $!\n"; |
118 | |||
117 | while (<$conffile>) { | 119 | while (<$conffile>) { |
118 | my $line = $_; | 120 | my $line = $_; |
119 | 121 | ||
@@ -961,6 +963,18 @@ sub which { | |||
961 | return ""; | 963 | return ""; |
962 | } | 964 | } |
963 | 965 | ||
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 | |||
964 | sub mailmap { | 978 | sub mailmap { |
965 | my (@lines) = @_; | 979 | my (@lines) = @_; |
966 | my %hash; | 980 | my %hash; |