Skip to content

Commit

Permalink
scripts/get_maintainer.pl: add .get_maintainer.conf default options file
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Florian Mickler <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JoePerches authored and torvalds committed May 25, 2010
1 parent e4d26b0 commit 368669d
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion scripts/get_maintainer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use strict;

my $P = $0;
my $V = '0.23';
my $V = '0.24';

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

Expand Down Expand Up @@ -107,6 +107,30 @@
"blame_commit_pattern" => "^([0-9a-f]+):"
);

if (-f "${lk_path}.get_maintainer.conf") {
my @conf_args;
open(my $conffile, '<', "${lk_path}.get_maintainer.conf")
or warn "$P: Can't open .get_maintainer.conf: $!\n";
while (<$conffile>) {
my $line = $_;

$line =~ s/\s*\n?$//g;
$line =~ s/^\s*//g;
$line =~ s/\s+/ /g;

next if ($line =~ m/^\s*#/);
next if ($line =~ m/^\s*$/);

my @words = split(" ", $line);
foreach my $word (@words) {
last if ($word =~ m/^#/);
push (@conf_args, $word);
}
}
close($conffile);
unshift(@ARGV, @conf_args) if @conf_args;
}

if (!GetOptions(
'email!' => \$email,
'git!' => \$email_git,
Expand Down Expand Up @@ -573,6 +597,11 @@ sub usage {
--git-min-signatures, --git-max-maintainers, --git-min-percent, and
--git-blame
Use --hg-since not --git-since to control date selection
File ".get_maintainer.conf", if it exists in the linux kernel source root
directory, can change whatever get_maintainer defaults are desired.
Entries in this file can be any command line argument.
This file is prepended to any additional command line arguments.
Multiple lines and # comments are allowed.
EOT
}

Expand Down

0 comments on commit 368669d

Please sign in to comment.