diff options
Diffstat (limited to 'scripts/get_maintainer.pl')
-rwxr-xr-x | scripts/get_maintainer.pl | 66 |
1 files changed, 56 insertions, 10 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 6f97a13bcee4..b2281982f52f 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -13,7 +13,7 @@ | |||
13 | use strict; | 13 | use strict; |
14 | 14 | ||
15 | my $P = $0; | 15 | my $P = $0; |
16 | my $V = '0.23'; | 16 | my $V = '0.24'; |
17 | 17 | ||
18 | use Getopt::Long qw(:config no_auto_abbrev); | 18 | use Getopt::Long qw(:config no_auto_abbrev); |
19 | 19 | ||
@@ -25,6 +25,7 @@ my $email_list = 1; | |||
25 | my $email_subscriber_list = 0; | 25 | my $email_subscriber_list = 0; |
26 | my $email_git_penguin_chiefs = 0; | 26 | my $email_git_penguin_chiefs = 0; |
27 | my $email_git = 1; | 27 | my $email_git = 1; |
28 | my $email_git_all_signature_types = 0; | ||
28 | my $email_git_blame = 0; | 29 | my $email_git_blame = 0; |
29 | my $email_git_min_signatures = 1; | 30 | my $email_git_min_signatures = 1; |
30 | my $email_git_max_maintainers = 5; | 31 | my $email_git_max_maintainers = 5; |
@@ -51,9 +52,9 @@ my $help = 0; | |||
51 | my $exit = 0; | 52 | my $exit = 0; |
52 | 53 | ||
53 | my @penguin_chief = (); | 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 | #Andrew wants in on most everything - 2009/01/14 | 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 | my @penguin_chief_names = (); | 59 | my @penguin_chief_names = (); |
59 | foreach my $chief (@penguin_chief) { | 60 | foreach my $chief (@penguin_chief) { |
@@ -63,7 +64,16 @@ foreach my $chief (@penguin_chief) { | |||
63 | push(@penguin_chief_names, $chief_name); | 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) . "\)"; |
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) . "\)"; | ||
67 | 77 | ||
68 | # rfc822 email address - preloaded methods go here. | 78 | # rfc822 email address - preloaded methods go here. |
69 | my $rfc822_lwsp = "(?:(?:\\r\\n)?[ \\t])"; | 79 | my $rfc822_lwsp = "(?:(?:\\r\\n)?[ \\t])"; |
@@ -97,9 +107,34 @@ my %VCS_cmds_hg = ( | |||
97 | "blame_commit_pattern" => "^([0-9a-f]+):" | 107 | "blame_commit_pattern" => "^([0-9a-f]+):" |
98 | ); | 108 | ); |
99 | 109 | ||
110 | if (-f "${lk_path}.get_maintainer.conf") { | ||
111 | my @conf_args; | ||
112 | open(my $conffile, '<', "${lk_path}.get_maintainer.conf") | ||
113 | or warn "$P: Can't open .get_maintainer.conf: $!\n"; | ||
114 | while (<$conffile>) { | ||
115 | my $line = $_; | ||
116 | |||
117 | $line =~ s/\s*\n?$//g; | ||
118 | $line =~ s/^\s*//g; | ||
119 | $line =~ s/\s+/ /g; | ||
120 | |||
121 | next if ($line =~ m/^\s*#/); | ||
122 | next if ($line =~ m/^\s*$/); | ||
123 | |||
124 | my @words = split(" ", $line); | ||
125 | foreach my $word (@words) { | ||
126 | last if ($word =~ m/^#/); | ||
127 | push (@conf_args, $word); | ||
128 | } | ||
129 | } | ||
130 | close($conffile); | ||
131 | unshift(@ARGV, @conf_args) if @conf_args; | ||
132 | } | ||
133 | |||
100 | if (!GetOptions( | 134 | if (!GetOptions( |
101 | 'email!' => \$email, | 135 | 'email!' => \$email, |
102 | 'git!' => \$email_git, | 136 | 'git!' => \$email_git, |
137 | 'git-all-signature-types!' => \$email_git_all_signature_types, | ||
103 | 'git-blame!' => \$email_git_blame, | 138 | 'git-blame!' => \$email_git_blame, |
104 | 'git-chief-penguins!' => \$email_git_penguin_chiefs, | 139 | 'git-chief-penguins!' => \$email_git_penguin_chiefs, |
105 | 'git-min-signatures=i' => \$email_git_min_signatures, | 140 | 'git-min-signatures=i' => \$email_git_min_signatures, |
@@ -180,6 +215,10 @@ if (!top_of_kernel_tree($lk_path)) { | |||
180 | . "a linux kernel source tree.\n"; | 215 | . "a linux kernel source tree.\n"; |
181 | } | 216 | } |
182 | 217 | ||
218 | if ($email_git_all_signature_types) { | ||
219 | $signaturePattern = "(.+?)[Bb][Yy]:"; | ||
220 | } | ||
221 | |||
183 | ## Read MAINTAINERS for type/value pairs | 222 | ## Read MAINTAINERS for type/value pairs |
184 | 223 | ||
185 | my @typevalue = (); | 224 | my @typevalue = (); |
@@ -497,13 +536,15 @@ version: $V | |||
497 | MAINTAINER field selection options: | 536 | MAINTAINER field selection options: |
498 | --email => print email address(es) if any | 537 | --email => print email address(es) if any |
499 | --git => include recent git \*-by: signers | 538 | --git => include recent git \*-by: signers |
539 | --git-all-signature-types => include signers regardless of signature type | ||
540 | or use only ${signaturePattern} signers (default: $email_git_all_signature_types) | ||
500 | --git-chief-penguins => include ${penguin_chiefs} | 541 | --git-chief-penguins => include ${penguin_chiefs} |
501 | --git-min-signatures => number of signatures required (default: 1) | 542 | --git-min-signatures => number of signatures required (default: $email_git_min_signatures) |
502 | --git-max-maintainers => maximum maintainers to add (default: 5) | 543 | --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers) |
503 | --git-min-percent => minimum percentage of commits required (default: 5) | 544 | --git-min-percent => minimum percentage of commits required (default: $email_git_min_percent) |
504 | --git-blame => use git blame to find modified commits for patch or file | 545 | --git-blame => use git blame to find modified commits for patch or file |
505 | --git-since => git history to use (default: 1-year-ago) | 546 | --git-since => git history to use (default: $email_git_since) |
506 | --hg-since => hg history to use (default: -365) | 547 | --hg-since => hg history to use (default: $email_hg_since) |
507 | --m => include maintainer(s) if any | 548 | --m => include maintainer(s) if any |
508 | --n => include name 'Full Name <addr\@domain.tld>' | 549 | --n => include name 'Full Name <addr\@domain.tld>' |
509 | --l => include list(s) if any | 550 | --l => include list(s) if any |
@@ -556,6 +597,11 @@ Notes: | |||
556 | --git-min-signatures, --git-max-maintainers, --git-min-percent, and | 597 | --git-min-signatures, --git-max-maintainers, --git-min-percent, and |
557 | --git-blame | 598 | --git-blame |
558 | Use --hg-since not --git-since to control date selection | 599 | Use --hg-since not --git-since to control date selection |
600 | File ".get_maintainer.conf", if it exists in the linux kernel source root | ||
601 | directory, can change whatever get_maintainer defaults are desired. | ||
602 | Entries in this file can be any command line argument. | ||
603 | This file is prepended to any additional command line arguments. | ||
604 | Multiple lines and # comments are allowed. | ||
559 | EOT | 605 | EOT |
560 | } | 606 | } |
561 | 607 | ||
@@ -964,7 +1010,7 @@ sub vcs_find_signers { | |||
964 | 1010 | ||
965 | $commits = grep(/$pattern/, @lines); # of commits | 1011 | $commits = grep(/$pattern/, @lines); # of commits |
966 | 1012 | ||
967 | @lines = grep(/^[-_ a-z]+by:.*\@.*$/i, @lines); | 1013 | @lines = grep(/^[ \t]*${signaturePattern}.*\@.*$/, @lines); |
968 | if (!$email_git_penguin_chiefs) { | 1014 | if (!$email_git_penguin_chiefs) { |
969 | @lines = grep(!/${penguin_chiefs}/i, @lines); | 1015 | @lines = grep(!/${penguin_chiefs}/i, @lines); |
970 | } | 1016 | } |