git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/1] git-send-email: Add a --suppress-all option
@ 2007-09-17 18:33 Felipe Balbi
  2007-09-18  7:40 ` Andreas Ericsson
  0 siblings, 1 reply; 6+ messages in thread
From: Felipe Balbi @ 2007-09-17 18:33 UTC (permalink / raw)
  To: git; +Cc: Felipe Balbi

From: Felipe Balbi <felipe.lima@indt.org.br>

This patch adds a --suppress-all option to avoid sending emails
to everybody but the ones listed by --to option.

Signed-off-by: Felipe Balbi <felipe.lima@indt.org.br>
---
 git-send-email.perl |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index d8319d4..e845c5f 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -88,6 +88,9 @@ Options:
    --suppress-from Suppress sending emails to yourself if your address
                   appears in a From: line. Defaults to off.
 
+   --suppress-all Suppress sending emails to everybody but addresses
+		  listed by --to option.
+
    --thread       Specify that the "In-Reply-To:" header should be set on all
                   emails. Defaults to on.
 
@@ -171,7 +174,7 @@ if ($@) {
 my ($quiet, $dry_run) = (0, 0);
 
 # Variables with corresponding config settings
-my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);
+my ($thread, $chain_reply_to, $suppress_from, $suppress_all, $signed_off_cc, $cc_cmd);
 my ($smtp_server, $smtp_authuser, $smtp_authpass, $smtp_ssl);
 my ($identity, $aliasfiletype, @alias_files);
 
@@ -179,6 +182,7 @@ my %config_bool_settings = (
     "thread" => [\$thread, 1],
     "chainreplyto" => [\$chain_reply_to, 1],
     "suppressfrom" => [\$suppress_from, 0],
+    "suppressall" => [\$suppress_all, 0],
     "signedoffcc" => [\$signed_off_cc, 1],
     "smtpssl" => [\$smtp_ssl, 0],
 );
@@ -212,6 +216,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
 		    "quiet" => \$quiet,
 		    "cc-cmd=s" => \$cc_cmd,
 		    "suppress-from!" => \$suppress_from,
+		    "suppress-all!" => \$suppress_all,
 		    "signed-off-cc|signed-off-by-cc!" => \$signed_off_cc,
 		    "dry-run" => \$dry_run,
 		    "envelope-sender=s" => \$envelope_sender,
@@ -662,8 +667,11 @@ foreach my $t (@files) {
 					$subject = $1;
 
 				} elsif (/^(Cc|From):\s+(.*)$/) {
-					if (unquote_rfc2047($2) eq $sender) {
-						next if ($suppress_from);
+					if (unquote_rfc2047($2)) {
+						next if ($suppress_all);
+					}
+					elsif (unquote_rfc2047($2) eq $sender) {
+						next if ($suppress_from|$suppress_all);
 					}
 					elsif ($1 eq 'From') {
 						$author = unquote_rfc2047($2);
@@ -700,7 +708,7 @@ foreach my $t (@files) {
 			}
 		} else {
 			$message .=  $_;
-			if (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc) {
+			if (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc && !$suppress_all) {
 				my $c = $2;
 				chomp $c;
 				push @cc, $c;
-- 
1.5.3.1.91.gd3392

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] git-send-email: Add a --suppress-all option
  2007-09-17 18:33 [PATCH 1/1] git-send-email: Add a --suppress-all option Felipe Balbi
@ 2007-09-18  7:40 ` Andreas Ericsson
  2007-09-18 13:22   ` J. Bruce Fields
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Ericsson @ 2007-09-18  7:40 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: git, Felipe Balbi

Felipe Balbi wrote:
> From: Felipe Balbi <felipe.lima@indt.org.br>
> 
> This patch adds a --suppress-all option to avoid sending emails
> to everybody but the ones listed by --to option.
> 

To my minds eye, --suppress-all is equivalent to --dry-run. Could you
rename it to "--cc-nobody" or some such?

On a side-note, I've never really understood why git-send-email *by default*
sends to a bazillion people. Does anybody ever use it without suppressing
most of the CC targets?

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] git-send-email: Add a --suppress-all option
  2007-09-18  7:40 ` Andreas Ericsson
@ 2007-09-18 13:22   ` J. Bruce Fields
  2007-09-18 13:29     ` Felipe Balbi
  2007-09-18 14:15     ` David Kastrup
  0 siblings, 2 replies; 6+ messages in thread
From: J. Bruce Fields @ 2007-09-18 13:22 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: Felipe Balbi, git, Felipe Balbi

On Tue, Sep 18, 2007 at 09:40:55AM +0200, Andreas Ericsson wrote:
> Felipe Balbi wrote:
>> From: Felipe Balbi <felipe.lima@indt.org.br>
>> This patch adds a --suppress-all option to avoid sending emails
>> to everybody but the ones listed by --to option.
>
> To my minds eye, --suppress-all is equivalent to --dry-run. Could you
> rename it to "--cc-nobody" or some such?
>
> On a side-note, I've never really understood why git-send-email *by 
> default*
> sends to a bazillion people. Does anybody ever use it without suppressing
> most of the CC targets?

Yes.  I never suppress the cc's.  The cc-everyone thing is standard on
the kernel mailing lists.

The one exception is if I'm just sending the series to myself as a test.

--b.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] git-send-email: Add a --suppress-all option
  2007-09-18 13:22   ` J. Bruce Fields
@ 2007-09-18 13:29     ` Felipe Balbi
  2007-09-18 14:15     ` David Kastrup
  1 sibling, 0 replies; 6+ messages in thread
From: Felipe Balbi @ 2007-09-18 13:29 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Andreas Ericsson, git, Felipe Balbi

Hi,

On 9/18/07, J. Bruce Fields <bfields@fieldses.org> wrote:
> On Tue, Sep 18, 2007 at 09:40:55AM +0200, Andreas Ericsson wrote:
> > Felipe Balbi wrote:
> >> From: Felipe Balbi <felipe.lima@indt.org.br>
> >> This patch adds a --suppress-all option to avoid sending emails
> >> to everybody but the ones listed by --to option.
> >
> > To my minds eye, --suppress-all is equivalent to --dry-run. Could you
> > rename it to "--cc-nobody" or some such?
> >
> > On a side-note, I've never really understood why git-send-email *by
> > default*
> > sends to a bazillion people. Does anybody ever use it without suppressing
> > most of the CC targets?
>
> Yes.  I never suppress the cc's.  The cc-everyone thing is standard on
> the kernel mailing lists.
>
> The one exception is if I'm just sending the series to myself as a test.

And that the motivation for this patch :-p

Internally (in my company, where I work), we send patches to each
other for code review before sending it publicly.

>
> --b.
>


-- 
Best Regards,

Felipe Balbi
felipebalbi@users.sourceforge.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] git-send-email: Add a --suppress-all option
  2007-09-18 13:22   ` J. Bruce Fields
  2007-09-18 13:29     ` Felipe Balbi
@ 2007-09-18 14:15     ` David Kastrup
  2007-09-18 14:39       ` Felipe Balbi
  1 sibling, 1 reply; 6+ messages in thread
From: David Kastrup @ 2007-09-18 14:15 UTC (permalink / raw)
  To: git

"J. Bruce Fields" <bfields@fieldses.org> writes:

> On Tue, Sep 18, 2007 at 09:40:55AM +0200, Andreas Ericsson wrote:
>> Felipe Balbi wrote:
>>> From: Felipe Balbi <felipe.lima@indt.org.br>
>>> This patch adds a --suppress-all option to avoid sending emails
>>> to everybody but the ones listed by --to option.
>>
>> To my minds eye, --suppress-all is equivalent to --dry-run. Could you
>> rename it to "--cc-nobody" or some such?
>>
>> On a side-note, I've never really understood why git-send-email *by 
>> default*
>> sends to a bazillion people. Does anybody ever use it without suppressing
>> most of the CC targets?
>
> Yes.  I never suppress the cc's.  The cc-everyone thing is standard on
> the kernel mailing lists.
>
> The one exception is if I'm just sending the series to myself as a test.

Wouldn't --no-cc be a nicer option name?

-- 
David Kastrup

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] git-send-email: Add a --suppress-all option
  2007-09-18 14:15     ` David Kastrup
@ 2007-09-18 14:39       ` Felipe Balbi
  0 siblings, 0 replies; 6+ messages in thread
From: Felipe Balbi @ 2007-09-18 14:39 UTC (permalink / raw)
  To: David Kastrup; +Cc: git

Hi,

On 9/18/07, David Kastrup <dak@gnu.org> wrote:
> "J. Bruce Fields" <bfields@fieldses.org> writes:
>
> > On Tue, Sep 18, 2007 at 09:40:55AM +0200, Andreas Ericsson wrote:
> >> Felipe Balbi wrote:
> >>> From: Felipe Balbi <felipe.lima@indt.org.br>
> >>> This patch adds a --suppress-all option to avoid sending emails
> >>> to everybody but the ones listed by --to option.
> >>
> >> To my minds eye, --suppress-all is equivalent to --dry-run. Could you
> >> rename it to "--cc-nobody" or some such?
> >>
> >> On a side-note, I've never really understood why git-send-email *by
> >> default*
> >> sends to a bazillion people. Does anybody ever use it without suppressing
> >> most of the CC targets?
> >
> > Yes.  I never suppress the cc's.  The cc-everyone thing is standard on
> > the kernel mailing lists.
> >
> > The one exception is if I'm just sending the series to myself as a test.
>
> Wouldn't --no-cc be a nicer option name?

It'll probably conflict if I don't wanna CC patch's author nor
Signed-off-by but DO want to CC somebody special like the maintainer.

the option is changed to --cc-nobody and it's already resent. :-)

>
> --
> David Kastrup
>
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


-- 
Best Regards,

Felipe Balbi
felipebalbi@users.sourceforge.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-09-18 14:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-17 18:33 [PATCH 1/1] git-send-email: Add a --suppress-all option Felipe Balbi
2007-09-18  7:40 ` Andreas Ericsson
2007-09-18 13:22   ` J. Bruce Fields
2007-09-18 13:29     ` Felipe Balbi
2007-09-18 14:15     ` David Kastrup
2007-09-18 14:39       ` Felipe Balbi

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).