Skip to content

Commit 368669d

Browse files
JoePerchestorvalds
authored andcommitted
scripts/get_maintainer.pl: add .get_maintainer.conf default options file
Allow the use of a .get_maintainer.conf file to control the default options applied when scripts/get_maintainer.pl is run. .get_maintainer.conf can contain any valid command-line argument. File contents are prepended to any additional command line arguments. Multiple lines may be used, blank lines ignored, # is a comment. Updated scripts/get_maintainer.pl version to 0.24 Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Florian Mickler <florian@mickler.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent e4d26b0 commit 368669d

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

‎scripts/get_maintainer.pl‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use strict;
1414

1515
my $P = $0;
16-
my $V = '0.23';
16+
my $V = '0.24';
1717

1818
use Getopt::Long qw(:config no_auto_abbrev);
1919

@@ -107,6 +107,30 @@
107107
"blame_commit_pattern" => "^([0-9a-f]+):"
108108
);
109109

110+
if (-f "${lk_path}.get_maintainer.conf") {
111+
my @conf_args;
112+
open(my $conffile, '<', "${lk_path}.get_maintainer.conf")
113+
or warn "$P: Can't open .get_maintainer.conf: $!\n";
114+
while (<$conffile>) {
115+
my $line = $_;
116+
117+
$line =~ s/\s*\n?$//g;
118+
$line =~ s/^\s*//g;
119+
$line =~ s/\s+/ /g;
120+
121+
next if ($line =~ m/^\s*#/);
122+
next if ($line =~ m/^\s*$/);
123+
124+
my @words = split(" ", $line);
125+
foreach my $word (@words) {
126+
last if ($word =~ m/^#/);
127+
push (@conf_args, $word);
128+
}
129+
}
130+
close($conffile);
131+
unshift(@ARGV, @conf_args) if @conf_args;
132+
}
133+
110134
if (!GetOptions(
111135
'email!' => \$email,
112136
'git!' => \$email_git,
@@ -573,6 +597,11 @@ sub usage {
573597
--git-min-signatures, --git-max-maintainers, --git-min-percent, and
574598
--git-blame
575599
Use --hg-since not --git-since to control date selection
600+
File ".get_maintainer.conf", if it exists in the linux kernel source root
601+
directory, can change whatever get_maintainer defaults are desired.
602+
Entries in this file can be any command line argument.
603+
This file is prepended to any additional command line arguments.
604+
Multiple lines and # comments are allowed.
576605
EOT
577606
}
578607

0 commit comments

Comments
 (0)