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

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/get_maintainer.pl+32−0
@@ -186,6 +186,27 @@ if (-f $conf) { · 185 unmodified lines
186 unshift(@ARGV, @conf_args) if @conf_args;186 unshift(@ARGV, @conf_args) if @conf_args;
187}187}
188 188
189my @ignore_emails = ();
190my $ignore_file = which_conf(".get_maintainer.ignore");
191if (-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
189if (!GetOptions(210if (!GetOptions(
190 'email!' => \$email,211 'email!' => \$email,
191 'git!' => \$email_git,212 'git!' => \$email_git,
@@ -513,6 +534,16 @@ if ($web) { · 321 unmodified lines
513 534
514exit($exit);535exit($exit);
515 536
537sub 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
516sub range_is_maintained {547sub range_is_maintained {
517 my ($start, $end) = @_;548 my ($start, $end) = @_;
518 549
@@ -1868,6 +1899,7 @@ sub vcs_assign { · 1349 unmodified lines
1868 my $percent = $sign_offs * 100 / $divisor;1899 my $percent = $sign_offs * 100 / $divisor;
1869 1900
1870 $percent = 100 if ($percent > 100);1901 $percent = 100 if ($percent > 100);
1902 next if (ignore_email_address($line));
1871 $count++;1903 $count++;
1872 last if ($sign_offs < $email_git_min_signatures ||1904 last if ($sign_offs < $email_git_min_signatures ||
1873 $count > $email_git_max_maintainers ||1905 $count > $email_git_max_maintainers ||