* Suppressing auto-cc for specific addresses
@ 2011-08-07 20:20 Daniel Mack
2011-08-07 23:46 ` Greg KH
2011-08-08 21:17 ` Jonathan Nieder
0 siblings, 2 replies; 12+ messages in thread
From: Daniel Mack @ 2011-08-07 20:20 UTC (permalink / raw)
To: git; +Cc: Greg Kroah-Hartman
[-- Attachment #1: Type: text/plain, Size: 655 bytes --]
Hi,
I'm looking for a way to suppress certain Cc: fields that are normally
automatically added for addresses mentioned in Cc: lines found in patches.
In particular, the kernel rules for marking patches for stable release
inclusion wants users to add a "Cc: stable@kernel.org" line in the patch
itself but to not actually send a copy of that patch to that address. It
will be picked automatically once the patch was applied upstream.
I couldn't find a proper way to do that with git send-email, so I dare
to come up with a patch proposal. Is that acceptable or is there any
better way (which I'm not aware about) to achive this?
Thanks,
Daniel
[-- Attachment #2: 0001-send-email-Allow-email-addresses-and-domains-as-supp.patch --]
[-- Type: text/plain, Size: 2899 bytes --]
From f1a17a4fbc0373283696cb560afff3afa05c2e8f Mon Sep 17 00:00:00 2001
From: Daniel Mack <zonque@gmail.com>
Date: Sun, 7 Aug 2011 22:16:00 +0200
Subject: [PATCH] send-email: Allow email addresses and domains as
--suppress-cc options
Signed-off-by: Daniel Mack <zonque@gmail.com>
---
Documentation/git-send-email.txt | 10 +++++++---
git-send-email.perl | 12 +++++++++++-
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 327233c..5966abb 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -233,9 +233,9 @@ Automating
cc list. Default is the value of 'sendemail.signedoffbycc' configuration
value; if that is unspecified, default to --signed-off-by-cc.
---suppress-cc=<category>::
- Specify an additional category of recipients to suppress the
- auto-cc of:
+--suppress-cc=<category|address|domain>::
+ Specify an additional category, email address or domain of recipients
+ to suppress the auto-cc for. Possible categories are:
+
--
- 'author' will avoid including the patch author
@@ -251,6 +251,10 @@ Automating
- 'all' will suppress all auto cc values.
--
+
+If a full email address is given, auto-cc will be suppressed for this particular
+address. This also works for entire domains if the parameter starts with the '@'
+sign. All email addresses in that domain will hence be ignored by auto-cc.
++
Default is the value of 'sendemail.suppresscc' configuration value; if
that is unspecified, default to 'self' if --suppress-from is
specified, as well as 'body' if --no-signed-off-cc is specified.
diff --git a/git-send-email.perl b/git-send-email.perl
index 98ab33a..22813e5 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -374,7 +374,7 @@ my(%suppress_cc);
if (@suppress_cc) {
foreach my $entry (@suppress_cc) {
die "Unknown --suppress-cc field: '$entry'\n"
- unless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc)$/;
+ unless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc|.*@.*)$/;
$suppress_cc{$entry} = 1;
}
}
@@ -1213,6 +1213,11 @@ foreach my $t (@files) {
} else {
next if ($suppress_cc{'cc'});
}
+ next if ($suppress_cc{$addr});
+ if ($addr =~ /^(.+)(@.+)$/) {
+ my $domain = $2;
+ next if $suppress_cc{$domain};
+ }
printf("(mbox) Adding cc: %s from line '%s'\n",
$addr, $_) unless $quiet;
push @cc, $addr;
@@ -1261,6 +1266,11 @@ foreach my $t (@files) {
next if $suppress_cc{'sob'} and $what =~ /Signed-off-by/i;
next if $suppress_cc{'bodycc'} and $what =~ /Cc/i;
}
+ next if ($suppress_cc{$c});
+ if ($c =~ /^(.+)(@.+)$/) {
+ my $domain = $2;
+ next if $suppress_cc{$domain};
+ }
push @cc, $c;
printf("(body) Adding cc: %s from line '%s'\n",
$c, $_) unless $quiet;
--
1.7.6
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: Suppressing auto-cc for specific addresses
2011-08-07 20:20 Suppressing auto-cc for specific addresses Daniel Mack
@ 2011-08-07 23:46 ` Greg KH
2011-08-08 7:24 ` Daniel Mack
2011-08-08 21:17 ` Jonathan Nieder
1 sibling, 1 reply; 12+ messages in thread
From: Greg KH @ 2011-08-07 23:46 UTC (permalink / raw)
To: Daniel Mack; +Cc: git
On Sun, Aug 07, 2011 at 10:20:26PM +0200, Daniel Mack wrote:
> Hi,
>
> I'm looking for a way to suppress certain Cc: fields that are
> normally automatically added for addresses mentioned in Cc: lines
> found in patches.
>
> In particular, the kernel rules for marking patches for stable
> release inclusion wants users to add a "Cc: stable@kernel.org" line
> in the patch itself but to not actually send a copy of that patch to
> that address. It will be picked automatically once the patch was
> applied upstream.
There is no "rule" that says you can not send a copy of the patch to
stable@kernel.org, in fact that happens a lot and is fine and I have no
problem with that at all.
So please don't feel that you have to do anything different here with
git to properly follow the stable kernel rules, there should not be any
need.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Suppressing auto-cc for specific addresses
2011-08-07 23:46 ` Greg KH
@ 2011-08-08 7:24 ` Daniel Mack
[not found] ` <D95ADFD4-2504-4BE6-BCD4-7B916F6F2FEB@gmail.com>
0 siblings, 1 reply; 12+ messages in thread
From: Daniel Mack @ 2011-08-08 7:24 UTC (permalink / raw)
To: Greg KH; +Cc: git
On Mon, Aug 8, 2011 at 1:46 AM, Greg KH <greg@kroah.com> wrote:
> On Sun, Aug 07, 2011 at 10:20:26PM +0200, Daniel Mack wrote:
>> I'm looking for a way to suppress certain Cc: fields that are
>> normally automatically added for addresses mentioned in Cc: lines
>> found in patches.
>>
>> In particular, the kernel rules for marking patches for stable
>> release inclusion wants users to add a "Cc: stable@kernel.org" line
>> in the patch itself but to not actually send a copy of that patch to
>> that address. It will be picked automatically once the patch was
>> applied upstream.
>
> There is no "rule" that says you can not send a copy of the patch to
> stable@kernel.org, in fact that happens a lot and is fine and I have no
> problem with that at all.
Ok, thanks for explaining. In fact, I've done it that way ever since,
and never thought that there is any problem with it. But the topic
came up lately on the ALSA ML (and was continued off-list later), and
reading Documentation/stable_kernel_rules.txt again, I became aware of
the fact that sending it to stable@ is not actually necessary (while
at the same time, it doesn't seem to be frowned upon).
Anyway, I found it strange not have a way in git to achive this, and
maybe this new feature has other uses, too?
Thanks,
Daniel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Suppressing auto-cc for specific addresses
2011-08-07 20:20 Suppressing auto-cc for specific addresses Daniel Mack
2011-08-07 23:46 ` Greg KH
@ 2011-08-08 21:17 ` Jonathan Nieder
2011-08-09 1:41 ` Joe Perches
1 sibling, 1 reply; 12+ messages in thread
From: Jonathan Nieder @ 2011-08-08 21:17 UTC (permalink / raw)
To: Daniel Mack
Cc: git, Greg Kroah-Hartman, Joe Perches,
Ævar Arnfjörð Bjarmason, J. Bruce Fields,
Jeff King
(+cc: some send-email people)
Hi,
Daniel Mack wrote:
> I'm looking for a way to suppress certain Cc: fields that are normally
> automatically added for addresses mentioned in Cc: lines found in patches.
Makes sense. Could you please add a quick commit message, following
the guidelines in Documentation/SubmittingPatches (i.e., explaining
the problem this intends to solve and justifying how it is solved)?
Patch left untrimmed for Joe and Ævar's convenience. Thanks and hope
that helps.
> From: Daniel Mack <zonque@gmail.com>
> Date: Sun, 7 Aug 2011 22:16:00 +0200
> Subject: [PATCH] send-email: Allow email addresses and domains as
> --suppress-cc options
>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> ---
> Documentation/git-send-email.txt | 10 +++++++---
> git-send-email.perl | 12 +++++++++++-
> 2 files changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
> index 327233c..5966abb 100644
> --- a/Documentation/git-send-email.txt
> +++ b/Documentation/git-send-email.txt
> @@ -233,9 +233,9 @@ Automating
> cc list. Default is the value of 'sendemail.signedoffbycc' configuration
> value; if that is unspecified, default to --signed-off-by-cc.
>
> ---suppress-cc=<category>::
> - Specify an additional category of recipients to suppress the
> - auto-cc of:
> +--suppress-cc=<category|address|domain>::
> + Specify an additional category, email address or domain of recipients
> + to suppress the auto-cc for. Possible categories are:
> +
> --
> - 'author' will avoid including the patch author
> @@ -251,6 +251,10 @@ Automating
> - 'all' will suppress all auto cc values.
> --
> +
> +If a full email address is given, auto-cc will be suppressed for this particular
> +address. This also works for entire domains if the parameter starts with the '@'
> +sign. All email addresses in that domain will hence be ignored by auto-cc.
> ++
> Default is the value of 'sendemail.suppresscc' configuration value; if
> that is unspecified, default to 'self' if --suppress-from is
> specified, as well as 'body' if --no-signed-off-cc is specified.
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 98ab33a..22813e5 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -374,7 +374,7 @@ my(%suppress_cc);
> if (@suppress_cc) {
> foreach my $entry (@suppress_cc) {
> die "Unknown --suppress-cc field: '$entry'\n"
> - unless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc)$/;
> + unless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc|.*@.*)$/;
> $suppress_cc{$entry} = 1;
> }
> }
> @@ -1213,6 +1213,11 @@ foreach my $t (@files) {
> } else {
> next if ($suppress_cc{'cc'});
> }
> + next if ($suppress_cc{$addr});
> + if ($addr =~ /^(.+)(@.+)$/) {
> + my $domain = $2;
> + next if $suppress_cc{$domain};
> + }
> printf("(mbox) Adding cc: %s from line '%s'\n",
> $addr, $_) unless $quiet;
> push @cc, $addr;
> @@ -1261,6 +1266,11 @@ foreach my $t (@files) {
> next if $suppress_cc{'sob'} and $what =~ /Signed-off-by/i;
> next if $suppress_cc{'bodycc'} and $what =~ /Cc/i;
> }
> + next if ($suppress_cc{$c});
> + if ($c =~ /^(.+)(@.+)$/) {
> + my $domain = $2;
> + next if $suppress_cc{$domain};
> + }
> push @cc, $c;
> printf("(body) Adding cc: %s from line '%s'\n",
> $c, $_) unless $quiet;
> --
> 1.7.6
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Suppressing auto-cc for specific addresses
2011-08-08 21:17 ` Jonathan Nieder
@ 2011-08-09 1:41 ` Joe Perches
0 siblings, 0 replies; 12+ messages in thread
From: Joe Perches @ 2011-08-09 1:41 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Daniel Mack, git, Greg Kroah-Hartman,
Ævar Arnfjörð Bjarmason, J. Bruce Fields,
Jeff King
On Mon, 2011-08-08 at 23:17 +0200, Jonathan Nieder wrote:
> (+cc: some send-email people)
> Daniel Mack wrote:
> > I'm looking for a way to suppress certain Cc: fields that are normally
> > automatically added for addresses mentioned in Cc: lines found in patches.
> Makes sense. Could you please add a quick commit message, following
> the guidelines in Documentation/SubmittingPatches (i.e., explaining
> the problem this intends to solve and justifying how it is solved)?
It seems an odd use case to me.
Why are these added addresses undesired?
Also this does not work for cccmd addresses.
You'll need to add similar logic to recipient_cmd
uses.
cheers, Joe
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-08-09 7:40 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-07 20:20 Suppressing auto-cc for specific addresses Daniel Mack
2011-08-07 23:46 ` Greg KH
2011-08-08 7:24 ` Daniel Mack
[not found] ` <D95ADFD4-2504-4BE6-BCD4-7B916F6F2FEB@gmail.com>
2011-08-08 10:58 ` Daniel Mack
2011-08-08 20:44 ` Jeff King
2011-08-08 21:01 ` Daniel Mack
2011-08-08 21:11 ` Greg KH
2011-08-08 21:07 ` Jonathan Nieder
2011-08-09 7:01 ` Jeff King
2011-08-09 7:40 ` Daniel Mack
2011-08-08 21:17 ` Jonathan Nieder
2011-08-09 1:41 ` Joe Perches
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).