Skip to content

Commit c1c3f2c

Browse files
JoePerchespaulmck
authored andcommitted
scripts: Teach get_maintainer.pl about the new "R:" tag
We can now designate reviewers in the MAINTAINERS file with the new "R:" tag, so this commit teaches get_maintainers.pl to add their email addresses. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
1 parent 34e2d56 commit c1c3f2c

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

‎scripts/get_maintainer.pl‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
my $email = 1;
2222
my $email_usename = 1;
2323
my $email_maintainer = 1;
24+
my $email_reviewer = 1;
2425
my $email_list = 1;
2526
my $email_subscriber_list = 0;
2627
my $email_git_penguin_chiefs = 0;
@@ -202,6 +203,7 @@
202203
'remove-duplicates!' => \$email_remove_duplicates,
203204
'mailmap!' => \$email_use_mailmap,
204205
'm!' => \$email_maintainer,
206+
'r!' => \$email_reviewer,
205207
'n!' => \$email_usename,
206208
'l!' => \$email_list,
207209
's!' => \$email_subscriber_list,
@@ -260,7 +262,8 @@
260262
}
261263

262264
if ($email &&
263-
($email_maintainer + $email_list + $email_subscriber_list +
265+
($email_maintainer + $email_reviewer +
266+
$email_list + $email_subscriber_list +
264267
$email_git + $email_git_penguin_chiefs + $email_git_blame) == 0) {
265268
die "$P: Please select at least 1 email option\n";
266269
}
@@ -750,6 +753,7 @@ sub usage {
750753
--hg-since => hg history to use (default: $email_hg_since)
751754
--interactive => display a menu (mostly useful if used with the --git option)
752755
--m => include maintainer(s) if any
756+
--r => include reviewer(s) if any
753757
--n => include name 'Full Name <addr\@domain.tld>'
754758
--l => include list(s) if any
755759
--s => include subscriber only list(s) if any
@@ -1064,6 +1068,22 @@ sub add_categories {
10641068
my $role = get_maintainer_role($i);
10651069
push_email_addresses($pvalue, $role);
10661070
}
1071+
} elsif ($ptype eq "R") {
1072+
my ($name, $address) = parse_email($pvalue);
1073+
if ($name eq "") {
1074+
if ($i > 0) {
1075+
my $tv = $typevalue[$i - 1];
1076+
if ($tv =~ m/^(\C):\s*(.*)/) {
1077+
if ($1 eq "P") {
1078+
$name = $2;
1079+
$pvalue = format_email($name, $address, $email_usename);
1080+
}
1081+
}
1082+
}
1083+
}
1084+
if ($email_reviewer) {
1085+
push_email_addresses($pvalue, 'reviewer');
1086+
}
10671087
} elsif ($ptype eq "T") {
10681088
push(@scm, $pvalue);
10691089
} elsif ($ptype eq "W") {

0 commit comments

Comments
 (0)