Re: [PATCH v2] git-send-email: show all headers when sending mail

4 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v2] git-send-email: show all headers when sending mail

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:52

Thanks.  Looks nice and obviously correct.

One thing that has been bugging me for a long time now stands
out like a sore thumb much more: empty Cc: is shown.

    $ git-send-email --dry-run --to=junio@my.isp.net 0001-branch-contains.txt
    Who should the emails appear to be from? [Junio C Hamano [off-list ref]]
    Emails will be sent from: Junio C Hamano [off-list ref]
    Message-ID to be used as In-Reply-To for the first email?
    0001-branch-contains.txt
    Dry-OK. Log says:
    Date: Mon, 19 Nov 2007 00:10:04 -0800
    Server: my.isp.net
    MAIL FROM:[off-list ref]
    RCPT TO:[off-list ref]
    From: Junio C Hamano [off-list ref]
    Subject: [PATCH] branch --contains=<commit>
    Cc:
    To: junkio@cox.net

    Result: OK

[PATCH] Don't print an empty Cc header in SMTP mode when there's no cc recipient defined

From: Ask Bjørn Hansen <hidden>
Date: 2016-06-15 22:43:52

Signed-off-by: Ask Bjørn Hansen <redacted>
---

There's some duplicate code between "what we do for sendmail"
and "what we do for SMTP" paths that should be fixed - this doesn't
do that, it only makes the SMTP path skip empty Cc lines...

 git-send-email.perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index fd0a4ad..65620ab 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -651,7 +651,11 @@ X-Mailer: git-send-email $gitversion
 		} else {
 			print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
 		}
-		print "From: $sanitized_sender\nSubject: $subject\nCc: $cc\nTo: $to\n\n";
+		print "From: $sanitized_sender\n"
+		     . "Subject: $subject\n"
+		     . ($cc ? "Cc: $cc\n" : "")
+		     . "To: $to\n"
+		     . "\n";
 		if ($smtp) {
 			print "Result: ", $smtp->code, ' ',
 				($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
-- 
1.5.3.5.561.g140d

Re: [PATCH v2] git-send-email: show all headers when sending mail

From: David D. Kilzer <hidden>
Date: 2016-06-15 22:43:52

I can't seem to reproduce this.  Could you send me (off-list)
0001-branch-contains.txt and any relevant config bits?

Dave


Junio C Hamano [off-list ref] wrote:
Thanks.  Looks nice and obviously correct.

One thing that has been bugging me for a long time now stands
out like a sore thumb much more: empty Cc: is shown.

    $ git-send-email --dry-run --to=junio@my.isp.net 0001-branch-contains.txt
    Who should the emails appear to be from? [Junio C Hamano
[off-list ref]]
    Emails will be sent from: Junio C Hamano [off-list ref]
    Message-ID to be used as In-Reply-To for the first email?
    0001-branch-contains.txt
    Dry-OK. Log says:
    Date: Mon, 19 Nov 2007 00:10:04 -0800
    Server: my.isp.net
    MAIL FROM:[off-list ref]
    RCPT TO:[off-list ref]
    From: Junio C Hamano [off-list ref]
    Subject: [PATCH] branch --contains=<commit>
    Cc:
    To: junkio@cox.net

    Result: OK

Re: [PATCH v2] git-send-email: show all headers when sending mail

From: Ask Bjørn Hansen <hidden>
Date: 2016-06-15 22:43:52

On Nov 19, 2007, at 10:50, David D. Kilzer wrote:
Junio C Hamano [off-list ref] wrote:
quoted
Thanks.  Looks nice and obviously correct.

One thing that has been bugging me for a long time now stands
out like a sore thumb much more: empty Cc: is shown.
I can't seem to reproduce this.  Could you send me (off-list)
0001-branch-contains.txt and any relevant config bits?
You need to make git-send-email not have an implicit Cc (from signed- 
off-by or some such), then it'll appear.

I sent a patch yesterday for it,

Subject: [PATCH] Don't print an empty Cc header in SMTP mode when  
there's no cc recipient defined
Message-Id: [off-list ref]



  - ask

-- 
http://develooper.com/ - http://askask.com/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help