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