diff mbox

[Xen-devel,v2] scripts/get_maintainers.pl: Don't blindly drop "THE REST" maintainers

Message ID 20170726171706.6428-1-julien.grall@arm.com
State Accepted
Commit 49b1ea9e0ea738f245ac372dcd9c9f528bdbb285
Headers show

Commit Message

Julien Grall July 26, 2017, 5:17 p.m. UTC
"THE REST" maintainers should always be CCed for any modification that
don't fall under the responsability of a specific component maintainer.

However, the script get_maintainers.pl will remove "THE REST"
maintainers as soon as one maintainer of a specific component will be
present.

Fix the script once for all.

Signed-off-by: Julien Grall <julien.grall@arm.com>

---

I am getting annoyed at requesting contributors to CC "THE REST" because
the script didn't properly return the list of maintainers. This should
now be fixed.

I didn't keep the acked because of the inversion of the logic.

    Changes in v2:
        - inverse the logic of the new variable and rename it to
        suppress_the_rest
---
 scripts/get_maintainer.pl | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

Comments

Wei Liu July 27, 2017, 10:42 a.m. UTC | #1
On Wed, Jul 26, 2017 at 06:17:06PM +0100, Julien Grall wrote:
> "THE REST" maintainers should always be CCed for any modification that
> don't fall under the responsability of a specific component maintainer.
> 
> However, the script get_maintainers.pl will remove "THE REST"
> maintainers as soon as one maintainer of a specific component will be
> present.
> 
> Fix the script once for all.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>
diff mbox

Patch

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 2804a5b5df..0ce2d367fa 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -571,11 +571,15 @@  sub get_maintainers {
     # Find responsible parties
 
     my %exact_pattern_match_hash = ();
+    # By default "THE REST" will be suppressed.
+    my $suppress_the_rest = 1;
 
     foreach my $file (@files) {
 
 	my %hash;
 	my $tvi = find_first_section();
+	# Unless stated otherwise, a file is maintained by "THE REST"
+	my $file_maintained_by_the_rest = 1;
 	while ($tvi < @typevalue) {
 	    my $start = find_starting_index($tvi);
 	    my $end = find_ending_index($tvi);
@@ -633,6 +637,14 @@  sub get_maintainers {
 
 	foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
 	    add_categories($line);
+	    my $role = get_maintainer_role($line);
+
+	    # Check the role, if it is not "THE REST" then the file is not
+	    # only maintained by "THE REST".
+	    if ( get_maintainer_role($line) ne "supporter:THE REST" ) {
+		    $file_maintained_by_the_rest = 0;
+	    }
+
 	    if ($sections) {
 		my $i;
 		my $start = find_starting_index($line);
@@ -657,6 +669,9 @@  sub get_maintainers {
 		print("\n");
 	    }
 	}
+	# If the file is only maintained by "THE REST", then CC all of them on
+	# the patch.
+	$suppress_the_rest = 0 if $file_maintained_by_the_rest;
     }
 
     if ($keywords) {
@@ -666,7 +681,8 @@  sub get_maintainers {
 	}
     }
 
-    if ($email_drop_the_rest_supporter_if_supporter_found && $#email_to > 0) {
+    if ($email_drop_the_rest_supporter_if_supporter_found &&
+	$suppress_the_rest && $#email_to > 0) {
         my @email_new;
         my $do_replace = 0;
         foreach my $email (@email_to) {