Commit e4d26b027a0b7e289fdc542fe06535329b457dd5

Authored by Joe Perches
Committed by Linus Torvalds
1 parent cf3b429b03

scripts/get_maintainer.pl: optionally ignore non-maintainer signatures

When using --git to determine who to send a patch to, get_maintainers will
currently include all signatures.  This can include signers that simply
report an issue or test a patch.  Signers that use this tag are not
necessarily good candidates to review new patches.

This patch allows get_maintainers to optionally restrict output to only
signatures that use Signed-off-by:, Acked-by:, or Reviewed-by:.

Signed-off-by: is included because those are people who are responsible
for the code.

Acked-by: is questionable, but as signers that use this tag tend to be
active linux gatekeepers, false positives are tolerable.

Reviewed-by: is included because signers responsible for the code thought
that the review feedback for a changeset by that signer was valuable.

This patch has been modified from Florian's original submission to change
the supported signature types to the canonical forms and use slightly
different spacing.  A couple of spacing issues were also corrected in the
original source.  The command line argument was also renamed.

Original-patch-by: Florian Mickler <florian@mickler.org>
Signed-off-by: Florian Mickler <florian@mickler.org>
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>

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

scripts/get_maintainer.pl
... ... @@ -25,6 +25,7 @@
25 25 my $email_subscriber_list = 0;
26 26 my $email_git_penguin_chiefs = 0;
27 27 my $email_git = 1;
  28 +my $email_git_all_signature_types = 1;
28 29 my $email_git_blame = 0;
29 30 my $email_git_min_signatures = 1;
30 31 my $email_git_max_maintainers = 5;
31 32  
... ... @@ -51,9 +52,9 @@
51 52 my $exit = 0;
52 53  
53 54 my @penguin_chief = ();
54   -push(@penguin_chief,"Linus Torvalds:torvalds\@linux-foundation.org");
  55 +push(@penguin_chief, "Linus Torvalds:torvalds\@linux-foundation.org");
55 56 #Andrew wants in on most everything - 2009/01/14
56   -#push(@penguin_chief,"Andrew Morton:akpm\@linux-foundation.org");
  57 +#push(@penguin_chief, "Andrew Morton:akpm\@linux-foundation.org");
57 58  
58 59 my @penguin_chief_names = ();
59 60 foreach my $chief (@penguin_chief) {
60 61  
... ... @@ -63,8 +64,17 @@
63 64 push(@penguin_chief_names, $chief_name);
64 65 }
65 66 }
66   -my $penguin_chiefs = "\(" . join("|",@penguin_chief_names) . "\)";
  67 +my $penguin_chiefs = "\(" . join("|", @penguin_chief_names) . "\)";
67 68  
  69 +# Signature types of people who are either
  70 +# a) responsible for the code in question, or
  71 +# b) familiar enough with it to give relevant feedback
  72 +my @signature_tags = ();
  73 +push(@signature_tags, "Signed-off-by:");
  74 +push(@signature_tags, "Reviewed-by:");
  75 +push(@signature_tags, "Acked-by:");
  76 +my $signaturePattern = "\(" . join("|", @signature_tags) . "\)";
  77 +
68 78 # rfc822 email address - preloaded methods go here.
69 79 my $rfc822_lwsp = "(?:(?:\\r\\n)?[ \\t])";
70 80 my $rfc822_char = '[\\000-\\377]';
... ... @@ -100,6 +110,7 @@
100 110 if (!GetOptions(
101 111 'email!' => \$email,
102 112 'git!' => \$email_git,
  113 + 'git-all-signature-types!' => \$email_git_all_signature_types,
103 114 'git-blame!' => \$email_git_blame,
104 115 'git-chief-penguins!' => \$email_git_penguin_chiefs,
105 116 'git-min-signatures=i' => \$email_git_min_signatures,
... ... @@ -180,6 +191,10 @@
180 191 . "a linux kernel source tree.\n";
181 192 }
182 193  
  194 +if ($email_git_all_signature_types) {
  195 + $signaturePattern = "(.+?)[Bb][Yy]:";
  196 +}
  197 +
183 198 ## Read MAINTAINERS for type/value pairs
184 199  
185 200 my @typevalue = ();
186 201  
187 202  
... ... @@ -497,13 +512,15 @@
497 512 MAINTAINER field selection options:
498 513 --email => print email address(es) if any
499 514 --git => include recent git \*-by: signers
  515 + --git-all-signature-types => include signers regardless of signature type
  516 + or use only ${signaturePattern} signers (default: $email_git_all_signature_types)
500 517 --git-chief-penguins => include ${penguin_chiefs}
501   - --git-min-signatures => number of signatures required (default: 1)
502   - --git-max-maintainers => maximum maintainers to add (default: 5)
503   - --git-min-percent => minimum percentage of commits required (default: 5)
  518 + --git-min-signatures => number of signatures required (default: $email_git_min_signatures)
  519 + --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers)
  520 + --git-min-percent => minimum percentage of commits required (default: $email_git_min_percent)
504 521 --git-blame => use git blame to find modified commits for patch or file
505   - --git-since => git history to use (default: 1-year-ago)
506   - --hg-since => hg history to use (default: -365)
  522 + --git-since => git history to use (default: $email_git_since)
  523 + --hg-since => hg history to use (default: $email_hg_since)
507 524 --m => include maintainer(s) if any
508 525 --n => include name 'Full Name <addr\@domain.tld>'
509 526 --l => include list(s) if any
... ... @@ -964,7 +981,7 @@
964 981  
965 982 $commits = grep(/$pattern/, @lines); # of commits
966 983  
967   - @lines = grep(/^[-_ a-z]+by:.*\@.*$/i, @lines);
  984 + @lines = grep(/^[ \t]*${signaturePattern}.*\@.*$/, @lines);
968 985 if (!$email_git_penguin_chiefs) {
969 986 @lines = grep(!/${penguin_chiefs}/i, @lines);
970 987 }