[XEN PATCH] get_maintainer: Add maintainers based on keyword after removing THE REST

Anthony PERARD posted 1 patch 3 days, 3 hours ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20260701162022.30265-1-anthony@xenproject.org
scripts/get_maintainer.pl | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
[XEN PATCH] get_maintainer: Add maintainers based on keyword after removing THE REST
Posted by Anthony PERARD 3 days, 3 hours ago
From: Anthony PERARD <anthony.perard@vates.tech>

There's some logic to avoid CC committers (THE REST section) when a
file is fully maintained by a list of maintainers. There's also some
logic to add maintainers if a patch or file contains some keywords.

We do add maintainers based on keyword to the list of $email_to before
checking if we can remove emails from THE REST. And at the time when
checking if we can drop THE REST, we've lost the information which
tell if the maintainers was added because of a keyword of because they
maintain the file.

Reorder the logic, add maintainers based on keywords only after
checking if we can drop THE REST.

For example, if we have a file covered by a sections with only
reviewers, but this file also contains the keyword "XSM", then:
    scripts/get_maintainer.pl -f $file
would suppress THE REST without this patch.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
---
 scripts/get_maintainer.pl | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 533d0df72ac1..b788665c08b2 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -720,13 +720,6 @@ sub get_maintainers {
 	$suppress_the_rest = 0 if $file_maintained_by_the_rest;
     }
 
-    if ($keywords) {
-	@keyword_tvi = sort_and_uniq(@keyword_tvi);
-	foreach my $line (@keyword_tvi) {
-	    add_categories($line);
-	}
-    }
-
     if ($email_drop_the_rest_supporter_if_supporter_found &&
 	$suppress_the_rest && $#email_to > 0) {
         my @email_new;
@@ -748,6 +741,13 @@ sub get_maintainers {
             if $do_replace;
     }
 
+    if ($keywords) {
+	@keyword_tvi = sort_and_uniq(@keyword_tvi);
+	foreach my $line (@keyword_tvi) {
+	    add_categories($line);
+	}
+    }
+
     foreach my $email (@email_to, @list_to) {
 	$email->[0] = deduplicate_email($email->[0]);
     }
-- 
Anthony PERARD