get_maintainer: Add --cc option
PATCH 1/1 get_maintainer: Add --cc option
The --cc adds a Cc: prefix infront of the email address so it can be used by other Scripts directly instead of adding another wrapper for this.
--- scripts/get_maintainer.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
scripts/get_maintainer.pl +9 -2
@@ -46,6 +46,8 @@ my $output_multiline = 1; my $output_separator = ", "; my $output_roles = 0; my $output_rolestats = 1; +my $output_cc_prefix = 0; +my $cc_prefix = ""; my $output_section_maxlen = 50; my $scm = 0; my $tree = 1;
@@ -252,6 +254,7 @@ if (!GetOptions( 'multiline!' => \$output_multiline, 'roles!' => \$output_roles, 'rolestats!' => \$output_rolestats, + 'cc!' => \$output_cc_prefix, 'separator=s' => \$output_separator, 'subsystem!' => \$subsystem, 'status!' => \$status,
@@ -298,6 +301,10 @@ $output_multiline = 0 if ($output_separator ne ", "); $output_rolestats = 1 if ($interactive); $output_roles = 1 if ($output_rolestats); +if ($output_cc_prefix) { + $cc_prefix = "Cc: "; +} + if ($sections || $letters ne "") { $sections = 1; $email = 0;
@@ -2462,9 +2469,9 @@ sub merge_email { my ($address, $role) = @$_; if (!$saw{$address}) { if ($output_roles) { - push(@lines, "$address ($role)"); + push(@lines, "$cc_prefix" . "$address ($role)"); } else { - push(@lines, $address); + push(@lines, "$cc_prefix" . "$address"); } $saw{$address} = 1; }
Signature · 1 line
2.20.1
Quoted 3 lines · Sebastian Andrzej Siewior
The --cc adds a Cc: prefix infront of the email address so it can be used by other Scripts directly instead of adding another wrapper for this.
Would it make sense to make '--cc' imply --no-roles --no-rolestats ?
Quoted 2 lines
Suggested-by Peter Zijlstra <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Thanks bigeasy!
Joe Perches
maintainerQuoted 4 lines · Peter Zijlstra
Quoted 3 lines · Sebastian Andrzej Siewior
The --cc adds a Cc: prefix infront of the email address so it can be used by other Scripts directly instead of adding another wrapper for this.
Not sure I like the "--cc" option naming. Maybe "--prefix [string]" to be a bit more generic.
Quoted 1 line
Would it make sense to make '--cc' imply --no-roles --no-rolestats ?
Maybe.
It's also unlikely to be sensibly used with mailing lists so maybe --nol too.
Quoted 9 lines · Joe Perches
Quoted 4 lines · Peter Zijlstra
Quoted 3 lines · Sebastian Andrzej Siewior
The --cc adds a Cc: prefix infront of the email address so it can be used by other Scripts directly instead of adding another wrapper for this.
Not sure I like the "--cc" option naming. Maybe "--prefix [string]" to be a bit more generic.
Quoted 6 lines
Quoted 1 line
Would it make sense to make '--cc' imply --no-roles --no-rolestats ?
Maybe.
It's also unlikely to be sensibly used with mailing lists so maybe --nol too.
Is there also an option to exclude moderated lists? --no-s doesn't seem to do that. I hate it when people cross-post to moderated lists, and this thing just made me do it :-(
Joe Perches
maintainerQuoted 10 lines · Peter Zijlstra
Quoted 9 lines · Joe Perches
Quoted 4 lines · Peter Zijlstra
Quoted 3 lines · Sebastian Andrzej Siewior
The --cc adds a Cc: prefix infront of the email address so it can be used by other Scripts directly instead of adding another wrapper for this.
Not sure I like the "--cc" option naming. Maybe "--prefix [string]" to be a bit more generic.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Would it make sense to make '--cc' imply --no-roles --no-rolestats ?
Maybe.
It's also unlikely to be sensibly used with mailing lists so maybe --nol too.
Is there also an option to exclude moderated lists?
Nope. Not yet ;)
Quoted 1 line
--no-s doesn't seem to do that.
I suppose a --nomoderated could work. (-m is already maintainers)
Quoted 2 lines
I hate it when people cross-post to moderated lists, and this thing just made me do it :-(
Maybe:
--- scripts/get_maintainer.pl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
scripts/get_maintainer.pl +10 -4
@@ -27,6 +27,7 @@ my $email_usename = 1; my $email_maintainer = 1; my $email_reviewer = 1; my $email_list = 1; +my $email_moderated_list = 1; my $email_subscriber_list = 0; my $email_git_penguin_chiefs = 0; my $email_git = 0;
@@ -248,6 +249,7 @@ if (!GetOptions( 'r!' => \$email_reviewer, 'n!' => \$email_usename, 'l!' => \$email_list, + 'moderated!' => \$email_moderated_list, 's!' => \$email_subscriber_list, 'multiline!' => \$output_multiline, 'roles!' => \$output_roles,
@@ -1023,7 +1025,8 @@ MAINTAINER field selection options: --r => include reviewer(s) if any --n => include name 'Full Name <addr\@domain.tld>' --l => include list(s) if any - --s => include subscriber only list(s) if any + --moderated => include moderated lists(s) if any (default: true) + --s => include subscriber only list(s) if any (default: false) --remove-duplicates => minimize duplicate email names/addresses --roles => show roles (status:subsystem, git-signer, list, etc...) --rolestats => show roles and statistics (commits/total_commits, %)
@@ -1313,11 +1316,14 @@ sub add_categories { } else { if ($email_list) { if (!$hash_list_to{lc($list_address)}) { - $hash_list_to{lc($list_address)} = 1; if ($list_additional =~ m/moderated/) { - push(@list_to, [$list_address, - "moderated list${list_role}"]); + if ($email_moderated_list) { + $hash_list_to{lc($list_address)} = 1; + push(@list_to, [$list_address, + "moderated list${list_role}"]); + } } else { + $hash_list_to{lc($list_address)} = 1; push(@list_to, [$list_address, "open list${list_role}"]); }
Peter Zijlstra
Tested-byQuoted 5 lines · Joe Perches
Quoted 2 lines · Peter Zijlstra
I hate it when people cross-post to moderated lists, and this thing just made me do it :-(
Maybe:
That seems to work,
Thanks!
Quoted 54 lines
--- scripts/get_maintainer.pl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)scripts/get_maintainer.pl +10
-4@@ -27,6 +27,7 @@ my $email_usename = 1; my $email_maintainer = 1; my $email_reviewer = 1; my $email_list = 1; +my $email_moderated_list = 1; my $email_subscriber_list = 0; my $email_git_penguin_chiefs = 0; my $email_git = 0;@@ -248,6 +249,7 @@ if (!GetOptions( 'r!' => \$email_reviewer, 'n!' => \$email_usename, 'l!' => \$email_list, + 'moderated!' => \$email_moderated_list, 's!' => \$email_subscriber_list, 'multiline!' => \$output_multiline, 'roles!' => \$output_roles,@@ -1023,7 +1025,8 @@ MAINTAINER field selection options: --r => include reviewer(s) if any --n => include name 'Full Name <addr\@domain.tld>' --l => include list(s) if any - --s => include subscriber only list(s) if any + --moderated => include moderated lists(s) if any (default: true) + --s => include subscriber only list(s) if any (default: false) --remove-duplicates => minimize duplicate email names/addresses --roles => show roles (status:subsystem, git-signer, list, etc...) --rolestats => show roles and statistics (commits/total_commits, %)@@ -1313,11 +1316,14 @@ sub add_categories { } else { if ($email_list) { if (!$hash_list_to{lc($list_address)}) { - $hash_list_to{lc($list_address)} = 1; if ($list_additional =~ m/moderated/) { - push(@list_to, [$list_address, - "moderated list${list_role}"]); + if ($email_moderated_list) { + $hash_list_to{lc($list_address)} = 1; + push(@list_to, [$list_address, + "moderated list${list_role}"]); + } } else { + $hash_list_to{lc($list_address)} = 1; push(@list_to, [$list_address, "open list${list_role}"]); }
Joe Perches
maintainerPATCH 1/1 get_maintainer: Add ability to skip moderated mailing lists
In reply to Peter ZijlstraAdd a command line switch --no-moderated to skip L: mailing lists marked with 'moderated'.
Some people prefer not emailing moderated mailing lists as the moderation time can be indeterminate and some emails can be intentionally dropped by a moderator.
This can cause fragmentation of email threads when some are subscribed to a moderated list but others are not and emails are dropped.
--- scripts/get_maintainer.pl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
scripts/get_maintainer.pl +10 -4
@@ -27,6 +27,7 @@ my $email_usename = 1; my $email_maintainer = 1; my $email_reviewer = 1; my $email_list = 1; +my $email_moderated_list = 1; my $email_subscriber_list = 0; my $email_git_penguin_chiefs = 0; my $email_git = 0;
@@ -248,6 +249,7 @@ if (!GetOptions( 'r!' => \$email_reviewer, 'n!' => \$email_usename, 'l!' => \$email_list, + 'moderated!' => \$email_moderated_list, 's!' => \$email_subscriber_list, 'multiline!' => \$output_multiline, 'roles!' => \$output_roles,
@@ -1023,7 +1025,8 @@ MAINTAINER field selection options: --r => include reviewer(s) if any --n => include name 'Full Name <addr\@domain.tld>' --l => include list(s) if any - --s => include subscriber only list(s) if any + --moderated => include moderated lists(s) if any (default: true) + --s => include subscriber only list(s) if any (default: false) --remove-duplicates => minimize duplicate email names/addresses --roles => show roles (status:subsystem, git-signer, list, etc...) --rolestats => show roles and statistics (commits/total_commits, %)
@@ -1313,11 +1316,14 @@ sub add_categories { } else { if ($email_list) { if (!$hash_list_to{lc($list_address)}) { - $hash_list_to{lc($list_address)} = 1; if ($list_additional =~ m/moderated/) { - push(@list_to, [$list_address, - "moderated list${list_role}"]); + if ($email_moderated_list) { + $hash_list_to{lc($list_address)} = 1; + push(@list_to, [$list_address, + "moderated list${list_role}"]); + } } else { + $hash_list_to{lc($list_address)} = 1; push(@list_to, [$list_address, "open list${list_role}"]); }
PATCH v2 1/1 get_maintainer: Add --prefix option
In reply to Joe PerchesThe --prefix option adds a Cc: prefix by default infront of the email address so it can be used by other Scripts directly instead of adding another wrapper for this.
The option takes an optional argument so "--prefix=Bcc: " is also valid. Since it is expected to be output an email address it implies "--no-roles --no-rolestats".
---
Quoted 7 lines · Joe Perches
Quoted 1 line · Peter Zijlstra
Would it make sense to make '--cc' imply --no-roles --no-rolestats ?
Maybe.
It's also unlikely to be sensibly used with mailing lists so maybe --nol too.
I don't see a problem with lists but I think it would make sense to imply also "--nomoderated" once available.
v1…v2:
- use --prefix instead --cc with "Cc: " as the default argument if not specified
- imply --no-roles --no-rolestats
scripts/get_maintainer.pl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
scripts/get_maintainer.pl +16 -2
@@ -46,6 +46,8 @@ my $output_multiline = 1; my $output_separator = ", "; my $output_roles = 0; my $output_rolestats = 1; +my $output_prefix = undef; +my $cc_prefix = ""; my $output_section_maxlen = 50; my $scm = 0; my $tree = 1;
@@ -252,6 +254,7 @@ if (!GetOptions( 'multiline!' => \$output_multiline, 'roles!' => \$output_roles, 'rolestats!' => \$output_rolestats, + 'prefix:s' => \$output_prefix, 'separator=s' => \$output_separator, 'subsystem!' => \$subsystem, 'status!' => \$status,
@@ -298,6 +301,16 @@ $output_multiline = 0 if ($output_separator ne ", "); $output_rolestats = 1 if ($interactive); $output_roles = 1 if ($output_rolestats); +if (defined($output_prefix)) { + if ($output_prefix eq "") { + $cc_prefix = "Cc: "; + } else { + $cc_prefix = $output_prefix; + } + $output_rolestats = 0; + $output_roles = 0; +} + if ($sections || $letters ne "") { $sections = 1; $email = 0;
@@ -1037,6 +1050,7 @@ version: $V --separator [, ] => separator for multiple entries on 1 line using --separator also sets --nomultiline if --separator is not [, ] --multiline => print 1 entry per line + --prefix => prints a prefix infront of the entry. CC: is default if not specified Other options: --pattern-depth => Number of pattern directory traversals (default: 0 (all))
@@ -2462,9 +2476,9 @@ sub merge_email { my ($address, $role) = @$_; if (!$saw{$address}) { if ($output_roles) { - push(@lines, "$address ($role)"); + push(@lines, "$cc_prefix" . "$address ($role)"); } else { - push(@lines, $address); + push(@lines, "$cc_prefix" . "$address"); } $saw{$address} = 1; }
Signature · 1 line
2.20.1
Joe Perches
maintainerRe: [PATCH v2] get_maintainer: Add --prefix option
Quoted 12 lines · Sebastian Andrzej Siewior
The --prefix option adds a Cc: prefix by default infront of the email address so it can be used by other Scripts directly instead of adding another wrapper for this.
The option takes an optional argument so "--prefix=Bcc: " is also valid. Since it is expected to be output an email address it implies "--no-roles --no-rolestats".Suggested-by Peter Zijlstra <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>---
Quoted 1 line · Joe Perches
On Mon, 2019-06-24 at 15:33 +0200, Peter Zijlstra wrote:
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Would it make sense to make '--cc' imply --no-roles --no-rolestats ?
Maybe.
It's also unlikely to be sensibly used with mailing lists so maybe --nol too.
I don't see a problem with lists
This isn't acceptable to me in its current form.
The most likely use case for this is to add "CC: <foo>" entries to a commit description.
I doubt anyone cares about the cc'd mailing lists in a commit description.
I'd prefer that commit descriptions don't have "CC:" lines at all as it was really only useful for adding email address to a proposed patch and as commit information is actually pretty useless.
There are now simple ways to make sure a patch submission is cc'd to appropriate parties.
git send-email supports --cc-cmd
Quoted 2 lines
but I think it would make sense to
imply also "--nomoderated" once available.
I do not believe that's true.
I want to proposed patches to moderated lists and believe everyone really should too.
I don't care if moderated lists send a "waiting for moderation" message as long as the list gets the proposed patch eventually.
I think only Peter cares about those, to him, superfluous "being moderated" messages.
scripts/get_maintainer.pl
Quoted 9 lines
v1…v2:
- use --prefix instead --cc with "Cc: " as the default argument if not specified
- imply --no-roles --no-rolestatsscripts/get_maintainer.pl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)scripts/get_maintainer.pl +0
-0
[]
scripts/get_maintainer.pl my $output_multiline = 1; · line 50
Quoted 6 lines
scripts/get_maintainer.pl +2
-0@@ -46,6 +46,8 @@ my $output_multiline = 1; my $output_separator = ", "; my $output_roles = 0; my $output_rolestats = 1; +my $output_prefix = undef; +my $cc_prefix = "";
Not necessary
scripts/get_maintainer.pl if (!GetOptions( · line 257
Quoted 8 lines
scripts/get_maintainer.pl +1
-0my $output_section_maxlen = 50; my $scm = 0; my $tree = 1;@@ -252,6 +254,7 @@ if (!GetOptions( 'multiline!' => \$output_multiline, 'roles!' => \$output_roles, 'rolestats!' => \$output_rolestats, + 'prefix:s' => \$output_prefix,
I'd prefer the user specify the prefix.
Quoted 6 lines
scripts/get_maintainer.pl +0
-0'separator=s' => \$output_separator, 'subsystem!' => \$subsystem, 'status!' => \$status,@@ -298,6 +301,16 @@ $output_multiline = 0 if ($output_separator ne ", "); $output_rolestats = 1 if ($interactive); $output_roles = 1 if ($output_rolestats);
scripts/get_maintainer.pl $output_multiline = 0 if ($output_separator ne ", "); · line 312
Quoted 10 lines
scripts/get_maintainer.pl +8
-0+if (defined($output_prefix)) { + if ($output_prefix eq "") { + $cc_prefix = "Cc: "; + } else { + $cc_prefix = $output_prefix; + } + $output_rolestats = 0; + $output_roles = 0;
I do not care for this.
If a switch is specified on the command line, it should be followed.
scripts/get_maintainer.pl version: $V · line 1053
Quoted 10 lines
scripts/get_maintainer.pl +2
-0+} + if ($sections || $letters ne "") { $sections = 1;$email = 0;scripts/get_maintainer.pl +1
-0@@ -1037,6 +1050,7 @@ version: $V --separator [, ] => separator for multiple entries on 1 line using --separator also sets --nomultiline if --separator is not [, ] --multiline => print 1 entry per line + --prefix => prints a prefix infront of the entry. CC: is default if not specified
infront isn't a word.
scripts/get_maintainer.pl sub merge_email { · line 2479
Quoted 9 lines
scripts/get_maintainer.pl +1
-1Other options: --pattern-depth => Number of pattern directory traversals (default: 0 (all))@@ -2462,9 +2476,9 @@ sub merge_email { my ($address, $role) = @$_; if (!$saw{$address}) { if ($output_roles) { - push(@lines, "$address ($role)"); + push(@lines, "$cc_prefix" . "$address ($role)");
It should not be $cc_prefix either, but $output_prefix
scripts/get_maintainer.pl sub merge_email { · line 2482
Quoted 4 lines
scripts/get_maintainer.pl +1
-1} else { - push(@lines, $address); + push(@lines, "$cc_prefix" . "$address"); }
And this should become something like:
if (!$saw($address)) {
my $output_address = "";
$output_address .= "$output_prefix " if (defined $output_prefix);
$output_address .= $address;
$output_address .= " ($role)" if ($output_roles);
push(@lines, $output_address);
$saw{$address} = 1;
}Re: [PATCH v2] get_maintainer: Add --prefix option
Quoted 4 lines · Joe Perches
There are now simple ways to make sure a patch submission is cc'd to appropriate parties.
git send-email supports --cc-cmd
That assumes one is using git; I'm not, git stinks.
Quoted 9 lines
I want to proposed patches to moderated lists and believe everyone really should too.
I don't care if moderated lists send a "waiting for moderation" message as long as the list gets the proposed patch eventually.
I think only Peter cares about those, to him, superfluous "being moderated" messages.
I'm really not alone in that. Not only do you get those annoying messages, the people reading that list might get the discussion in fragments, because some people that reply are subscribed and do not require moderation while others do get caught in the moderation thing and then delayed.
It also puts a burden on the moderator, do they allow the whole discussion or only part. What if they deem the thing off-topic and want to kill it, but then some of their whitelisted people do reply.
Cross-posting to moderated lists has been considered bad form ever since I got on the interweb in the early 90s.
Joe Perches
maintainerRe: [PATCH v2] get_maintainer: Add --prefix option
Quoted 1 line · Peter Zijlstra
On Tue, Jun 25, 2019 at 10:23:34AM -0700, Joe Perches wrote:
[]
Quoted 7 lines
Quoted 7 lines
I want to proposed patches to moderated lists and believe everyone really should too.
I don't care if moderated lists send a "waiting for moderation" message as long as the list gets the proposed patch eventually.
Quoted 8 lines
Quoted 2 lines
I think only Peter cares about those, to him, superfluous "being moderated" messages.
I'm really not alone in that. Not only do you get those annoying messages, the people reading that list might get the discussion in fragments, because some people that reply are subscribed and do not require moderation while others do get caught in the moderation thing and then delayed.
<shrug> email moderation time is up to any moderator.
Quoted 3 lines
It also puts a burden on the moderator, do they allow the whole discussion or only part. What if they deem the thing off-topic and want to kill it, but then some of their whitelisted people do reply.
Please remember any moderated list entries originate here by using get_maintainers.pl for a proposed patch or discuss a particular subsystem.
If a moderator of a list decides an email chain about a patch is somehow off-topic and does not forward the email, likely that moderated list should be removed from MAINTAINERS.
Under what use case would you want to use get_maintainer and _not_ cc a particular mailing list?
Re: [PATCH v2] get_maintainer: Add --prefix option
Quoted 5 lines · Joe Perches
On Wed, 2019-06-26 at 11:36 +0200, Peter Zijlstra wrote:
If a moderator of a list decides an email chain about a patch is somehow off-topic and does not forward the email, likely that moderated list should be removed from
MAINTAINERS.
I think I've seen kernel-hardening complain about this; and that's not even a moderated list I think. Yes, the patch touched one of 'their' files, but was mostly unrelated.
I forgot the exact thread.
Quoted 2 lines
Under what use case would you want to use
get_maintainerand _not_ cc a particular mailing list?
I'm basically going to never send anything to a moderated list, ever. It's what I've been doing for a long while, but I got lazy the other day because a patch I did was a wide spray all over the tree and I didn't want to manually compose the Cc list.