History

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.

Joe Perches committed 11 years ago

Commit 435de071 parent 3ea43311 file · +32 −0Browse files

Unified · Split

scripts/get_maintainer.pl+32−0
@@ -186,6 +186,27 @@ if (-f $conf) { · 185 unmodified lines
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 @@ if ($web) { · 321 unmodified lines
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 { · 1349 unmodified lines
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 ||