Commit 368669da205cd7aac33a2c75f4c81b5ad28efd67

Authored by Joe Perches
Committed by Linus Torvalds
1 parent e4d26b027a

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>

Showing 1 changed file with 30 additions and 1 deletions Side-by-side Diff

scripts/get_maintainer.pl
... ... @@ -13,7 +13,7 @@
13 13 use strict;
14 14  
15 15 my $P = $0;
16   -my $V = '0.23';
  16 +my $V = '0.24';
17 17  
18 18 use Getopt::Long qw(:config no_auto_abbrev);
19 19  
... ... @@ -107,6 +107,30 @@
107 107 "blame_commit_pattern" => "^([0-9a-f]+):"
108 108 );
109 109  
  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 +
110 134 if (!GetOptions(
111 135 'email!' => \$email,
112 136 'git!' => \$email_git,
... ... @@ -573,6 +597,11 @@
573 597 --git-min-signatures, --git-max-maintainers, --git-min-percent, and
574 598 --git-blame
575 599 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.
576 605 EOT
577 606 }
578 607