Skip to content

Commit 435de07

Browse files
JoePerchestorvalds
authored andcommitted
get_maintainer.pl: add .get_maintainer.ignore file capability
Some people prefer not to be cc'd on patches. Add an ability to have a file (.get_maintainer.ignore) with names and email addresses that are excluded from being listed except when specifically listed as a maintainer in a section. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3ea4331 commit 435de07

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

‎scripts/get_maintainer.pl‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,27 @@
186186
unshift(@ARGV, @conf_args) if @conf_args;
187187
}
188188

189+
my @ignore_emails = ();
190+
my $ignore_file = which_conf(".get_maintainer.ignore");
191+
if (-f $ignore_file) {
192+
open(my $ignore, '<', "$ignore_file")
193+
or warn "$P: Can't find a readable .get_maintainer.ignore file $!\n";
194+
while (<$ignore>) {
195+
my $line = $_;
196+
197+
$line =~ s/\s*\n?$//;
198+
$line =~ s/^\s*//;
199+
$line =~ s/\s+$//;
200+
$line =~ s/#.*$//;
201+
202+
next if ($line =~ m/^\s*$/);
203+
if (rfc822_valid($line)) {
204+
push(@ignore_emails, $line);
205+
}
206+
}
207+
close($ignore);
208+
}
209+
189210
if (!GetOptions(
190211
'email!' => \$email,
191212
'git!' => \$email_git,
@@ -513,6 +534,16 @@ sub read_mailmap {
513534

514535
exit($exit);
515536

537+
sub ignore_email_address {
538+
my ($address) = @_;
539+
540+
foreach my $ignore (@ignore_emails) {
541+
return 1 if ($ignore eq $address);
542+
}
543+
544+
return 0;
545+
}
546+
516547
sub range_is_maintained {
517548
my ($start, $end) = @_;
518549

@@ -1868,6 +1899,7 @@ sub vcs_assign {
18681899
my $percent = $sign_offs * 100 / $divisor;
18691900

18701901
$percent = 100 if ($percent > 100);
1902+
next if (ignore_email_address($line));
18711903
$count++;
18721904
last if ($sign_offs < $email_git_min_signatures ||
18731905
$count > $email_git_max_maintainers ||

0 commit comments

Comments
 (0)