get_maintainer: Add maintainers based on keyword after removing THE REST
PATCH 1/1 get_maintainer: Add maintainers based on keyword after removing THE REST
From: Anthony PERARD <[email protected]>
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.
--- scripts/get_maintainer.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
scripts/get_maintainer.pl +7 -7
@@ -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]); }
Signature · 1 line
Anthony PERARD
Quoted 15 lines · Anthony PERARD
From: Anthony PERARD <[email protected]>
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.
Quoted 6 lines
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 <[email protected]>
Seeing that no-one else (with better Perl knowledge than mine) responded so far, based on this looking plausible:
Jan