From: Joe Perches <joe@perches.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] get_maintainer: Add --prefix option
Date: Tue, 25 Jun 2019 10:23:34 -0700 [thread overview]
Message-ID: <8d416a7b0dad3933ceb8d12c9efaad541f7cf269.camel@perches.com> (raw)
In-Reply-To: <20190625163701.xcb2ue7phpskvfnz@linutronix.de>
On Tue, 2019-06-25 at 18:37 +0200, Sebastian Andrzej Siewior wrote:
> 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 <peterz@infradead.org>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> On 2019-06-24 07:27:47 [-0700], Joe Perches wrote:
> > On Mon, 2019-06-24 at 15:33 +0200, Peter Zijlstra wrote:
> > > 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
> 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.
> 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(-)
>
> diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
[]
> @@ -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
> 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,
I'd prefer the user specify the 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;
I do not care for this.
If a switch is specified on the command line,
it should be followed.
> +}
> +
> 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
infront isn't a word.
>
> 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)");
It should not be $cc_prefix either, but $output_prefix
> } 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;
}
next prev parent reply other threads:[~2019-06-25 17:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-24 13:03 [PATCH] get_maintainer: Add --cc option Sebastian Andrzej Siewior
2019-06-24 13:33 ` Peter Zijlstra
2019-06-24 14:27 ` Joe Perches
2019-06-24 20:25 ` Peter Zijlstra
2019-06-24 20:42 ` Joe Perches
2019-06-25 7:45 ` Peter Zijlstra
2019-06-28 9:25 ` [PATCH] get_maintainer: Add ability to skip moderated mailing lists Joe Perches
2019-06-25 16:37 ` [PATCH v2] get_maintainer: Add --prefix option Sebastian Andrzej Siewior
2019-06-25 17:23 ` Joe Perches [this message]
2019-06-26 9:36 ` Peter Zijlstra
2019-06-26 15:36 ` Joe Perches
2019-06-26 17:18 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d416a7b0dad3933ceb8d12c9efaad541f7cf269.camel@perches.com \
--to=joe@perches.com \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).