get_maintainer: add recipients to output of script
PATCH 1/1 get_maintainer: add recipients to output of script
Add all people tagged in all the mentioned commits to the output of this script.
--- scripts/get_maintainer.pl | 11 +++++++++++ 1 file changed, 11 insertions(+)
scripts/get_maintainer.pl +11 -0
@@ -30,6 +30,7 @@ my $email_usename = 1; my $email_maintainer = 1; my $email_reviewer = 1; my $email_fixes = 1; +my $email_mentioned = 1; my $email_list = 1; my $email_moderated_list = 1; my $email_subscriber_list = 0;
@@ -78,6 +79,7 @@ my $exit = 0; my @files = (); my @fixes = (); # If a patch description includes Fixes: lines +my @mentioned = (); # If a patch description mentiones a patch my @range = (); my @keyword_tvi = (); my @file_emails = ();
@@ -264,6 +266,7 @@ if (!GetOptions( 'n!' => \$email_usename, 'l!' => \$email_list, 'fixes!' => \$email_fixes, + 'mentioned!' => \$email_mentioned, 'moderated!' => \$email_moderated_list, 's!' => \$email_subscriber_list, 'multiline!' => \$output_multiline,
@@ -606,6 +609,8 @@ foreach my $file (@ARGV) { push(@files, $filename2); } elsif (m/^Fixes:\s+([0-9a-fA-F]{6,40})/) { push(@fixes, $1) if ($email_fixes); + } elsif (m/\s+([0-9a-fA-F]{6,40})/) { + push(@mentioned, $1) if ($email_mentioned); } elsif (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) { my $filename = $1; $filename =~ s@^[^/]*/@@;
@@ -637,6 +642,7 @@ foreach my $file (@ARGV) { @file_emails = uniq(@file_emails); @fixes = uniq(@fixes); +@mentioned = uniq(@mentioned); my %email_hash_name; my %email_hash_address;
@@ -1038,6 +1044,10 @@ sub get_maintainers { vcs_add_commit_signers($fix, "blamed_fixes"); } + foreach my $mention (@mentioned) { + vcs_add_commit_signers($mention, "in mentioned Patch"); + } + my @to = (); if ($email || $email_list) { if ($email) {
@@ -1106,6 +1116,7 @@ MAINTAINER field selection options: --substatus => show subsystem status if not Maintained (default: match --roles when output is tty)" --file-emails => add email addresses found in -f file (default: 0 (off)) --fixes => for patches, add signatures of commits with 'Fixes: <commit>' (default: 1 (on)) + --mentioned => for patches, add signatures in mentioned commits with hashes between 6 and 40 chars long (default: 1 (on)) --scm => print SCM tree(s) if any --status => print status if any --subsystem => print subsystem name if any
Signature · 1 line
2.54.0
Joe Perches
maintainerQuoted 1 line · Manuel Ebner
Add all people tagged in all the mentioned commits to the output of this script.
Why?
Quoted 4 lines · Joe Perches
Quoted 1 line · Manuel Ebner
Add all people tagged in all the mentioned commits to the output of this script.
Why?
Because sometimes there is a reason to add them. Doing so with get_maintainer spares the manual copying and pasting.
Thanks
Manuel
Joe Perches
maintainerQuoted 7 lines · Manuel Ebner
On Mon, 2026-06-08 at 08:29 -0700, Joe Perches wrote:
On Mon, 2026-06-08 at 17:22 +0200, Manuel Ebner wrote:
Add all people tagged in all the mentioned commits to the output of this script.Quoted 1 line
Why?
Because sometimes there is a reason to add them. Doing so with
get_maintainerspares the manual copying and pasting.
Please specify this reason in the changelog.
_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Quoted 10 lines · Joe Perches
Quoted 7 lines · Manuel Ebner
On Mon, 2026-06-08 at 08:29 -0700, Joe Perches wrote:
On Mon, 2026-06-08 at 17:22 +0200, Manuel Ebner wrote:
Add all people tagged in all the mentioned commits to the output of this script.Quoted 1 line
Why?
Because sometimes there is a reason to add them. Doing so with
get_maintainerspares the manual copying and pasting.Please specify this reason in the changelog.
I will do that in a new version.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
+my $email_mentioned = 1;
Is it ok to have this on by default or should I turn it off?
Thanks
Manuel
Joe Perches
maintainerQuoted 1 line · Manuel Ebner
Is it ok to have this on by default or should I turn it off?
Has to be off. Otherwise all the 'cc:' lines would be used.
And fyi: I doubt the utility of this new mechanism.
Quoted 11 lines · Joe Perches
Quoted 7 lines · Manuel Ebner
On Mon, 2026-06-08 at 08:29 -0700, Joe Perches wrote:
On Mon, 2026-06-08 at 17:22 +0200, Manuel Ebner wrote:
Add all people tagged in all the mentioned commits to the output of this script.Quoted 1 line
Why?
Because sometimes there is a reason to add them. Doing so with
get_maintainerspares the manual copying and pasting.Please specify this reason in the changelog.
Is the original message outside the kernelnewbies list?
I do not see the original message in the kernelnewbies list, and neither I see Manuel's messages, so I'm lacking context here.
Signature · 8 lines
Agatha Isabelle Moreira C Developer | agatha.dev Sourcehut: https://sr.ht/~devlavender/ _______________________________________________ Kernelnewbies mailing list [email protected] https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
PATCH 1/1 get_maintainer: add recipients to output of script
In reply to Joe PerchesAdd all people tagged in all the mentioned commits to the output of this script. This is done to give credit to people who inspired the current commit or to get feedback from people who know the subject.
--- scripts/get_maintainer.pl | 11 +++++++++++ 1 file changed, 11 insertions(+)
scripts/get_maintainer.pl +11 -0
@@ -30,6 +30,7 @@ my $email_usename = 1; my $email_maintainer = 1; my $email_reviewer = 1; my $email_fixes = 1; +my $email_mentioned = 0; my $email_list = 1; my $email_moderated_list = 1; my $email_subscriber_list = 0;
@@ -78,6 +79,7 @@ my $exit = 0; my @files = (); my @fixes = (); # If a patch description includes Fixes: lines +my @mentioned = (); # If a patch description mentiones a patch my @range = (); my @keyword_tvi = (); my @file_emails = ();
@@ -264,6 +266,7 @@ if (!GetOptions( 'n!' => \$email_usename, 'l!' => \$email_list, 'fixes!' => \$email_fixes, + 'mentioned!' => \$email_mentioned, 'moderated!' => \$email_moderated_list, 's!' => \$email_subscriber_list, 'multiline!' => \$output_multiline,
@@ -606,6 +609,8 @@ foreach my $file (@ARGV) { push(@files, $filename2); } elsif (m/^Fixes:\s+([0-9a-fA-F]{6,40})/) { push(@fixes, $1) if ($email_fixes); + } elsif (m/\s+([0-9a-fA-F]{6,40})/) { + push(@mentioned, $1) if ($email_mentioned); } elsif (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) { my $filename = $1; $filename =~ s@^[^/]*/@@;
@@ -637,6 +642,7 @@ foreach my $file (@ARGV) { @file_emails = uniq(@file_emails); @fixes = uniq(@fixes); +@mentioned = uniq(@mentioned); my %email_hash_name; my %email_hash_address;
@@ -1038,6 +1044,10 @@ sub get_maintainers { vcs_add_commit_signers($fix, "blamed_fixes"); } + foreach my $mention (@mentioned) { + vcs_add_commit_signers($mention, "in mentioned Patch"); + } + my @to = (); if ($email || $email_list) { if ($email) {
@@ -1106,6 +1116,7 @@ MAINTAINER field selection options: --substatus => show subsystem status if not Maintained (default: match --roles when output is tty)" --file-emails => add email addresses found in -f file (default: 0 (off)) --fixes => for patches, add signatures of commits with 'Fixes: <commit>' (default: 1 (on)) + --mentioned => for patches, add signatures in mentioned commits with hashes between 6 and 40 chars long (default: 1 (on)) --scm => print SCM tree(s) if any --status => print status if any --subsystem => print subsystem name if any
Signature · 1 line
2.54.0
Quoted 3 lines · Manuel Ebner
Add all people tagged in all the mentioned commits to the output of this script. This is done to give credit to people who inspired the current commit or to get feedback from people who know the subject.
Some things to notice:
1) Cc someone in the message is not the way of giving credit, the tags are already for that.
2) The way get_maintainer.pl works today already copies the relevant people, you should state why your addition matters to that.
3) You are supposed to send the message again with [PATCH v2] in the subject if you want your message to be tracked as a new version of the patch. In that case you must include a changelog stating your changes.
See: https://docs.kernel.org/process/submitting-patches.html
4) I'm not sure why people in the mentioned patches should necessarily be copied in a patch. I mean, if they are active contributors to that part of the code they are likely already included in the regular get_maintainer.pl output, they will either be listed in the MAINTAINERS file or at least be fetched through git.
Keep in mind that get_maintainer.pl is not intended to be used to spam people, but to get where to send your patches and who to copy.
Quoted 28 lines
index
16b80a700d4a..8c44b14391f9100755scripts/get_maintainer.pl +3
-0@@ -30,6 +30,7 @@ my $email_usename = 1; my $email_maintainer = 1; my $email_reviewer = 1; my $email_fixes = 1; +my $email_mentioned = 0; my $email_list = 1; my $email_moderated_list = 1; my $email_subscriber_list = 0;@@ -78,6 +79,7 @@ my $exit = 0; my @files = (); my @fixes = (); # If a patch description includes Fixes: lines +my @mentioned = (); # If a patch description mentiones a patch my @range = (); my @keyword_tvi = (); my @file_emails = ();@@ -264,6 +266,7 @@ if (!GetOptions( 'n!' => \$email_usename, 'l!' => \$email_list, 'fixes!' => \$email_fixes, + 'mentioned!' => \$email_mentioned, 'moderated!' => \$email_moderated_list, 's!' => \$email_subscriber_list, 'multiline!' => \$output_multiline,
scripts/get_maintainer.pl foreach my $file (@ARGV) { · line 613
Quoted 5 lines
scripts/get_maintainer.pl +2
-0@@ -606,6 +609,8 @@ foreach my $file (@ARGV) { push(@files, $filename2); } elsif (m/^Fixes:\s+([0-9a-fA-F]{6,40})/) { push(@fixes, $1) if ($email_fixes); + } elsif (m/\s+([0-9a-fA-F]{6,40})/) { + push(@mentioned, $1) if ($email_mentioned);
If you still wanna submit this patch anyway, besides explaining the reason to be accepted, I think you should check if your regex isn't matching anything other than commit messages. For instance, I can easily imagine this regex matching a regular hash that's not a commit id or a memory address.
Imagine you have a kernel panic log in the commit message, for instance. I think your script would likely misinterpret register values as commit messages.
Really need to work on that. Though I would recommend that you discuss with the list first and try to get people to understand why this might be important first so you don't waste time fixing something that might not get accepted. Unless you wanna use it for yourself locally.
Signature · 3 lines
Agatha Isabelle Moreira C Developer | agatha.dev Sourcehut: https://sr.ht/~devlavender/
Quoted 5 lines · Agatha Isabelle Moreira
Quoted 2 lines · Manuel Ebner
...
...
Thanks for the insight, i'll ditch the patch.
Manuel