diff options
author | David D. Kilzer <ddkilzer@kilzer.net> | 2007-11-18 20:14:55 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-11-19 00:19:46 -0800 |
commit | b7f30e0a972ab90a0f7720a7d6411822eb796ea3 (patch) | |
tree | 4d568fef33568c27843c2a4be9692d44d632b064 /t/t9001-send-email.sh | |
parent | Merge branch 'maint' (diff) | |
download | tgif-b7f30e0a972ab90a0f7720a7d6411822eb796ea3.tar.xz |
git-send-email: show all headers when sending mail
As a git newbie, it was confusing to set an In-Reply-To header but then
not see it printed when the git-send-email command was run.
This patch prints all headers that would be sent to sendmail or an SMTP
server instead of only printing From, Subject, Cc, To. It also removes
the now-extraneous Date header after the "Log says" line.
Added test to t/t9001-send-email.sh.
Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9001-send-email.sh')
-rwxr-xr-x | t/t9001-send-email.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 83f9470202..659f9c758f 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -41,4 +41,41 @@ test_expect_success \ 'Verify commandline' \ 'diff commandline expected' +cat >expected-show-all-headers <<\EOF +0001-Second.patch +(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>' +Dry-OK. Log says: +Server: relay.example.com +MAIL FROM:<from@example.com> +RCPT TO:<to@example.com>,<cc@example.com>,<author@example.com>,<bcc@example.com> +From: Example <from@example.com> +To: to@example.com +Cc: cc@example.com, A <author@example.com> +Subject: [PATCH 1/1] Second. +Date: DATE-STRING +Message-Id: MESSAGE-ID-STRING +X-Mailer: X-MAILER-STRING +In-Reply-To: <unique-message-id@example.com> +References: <unique-message-id@example.com> + +Result: OK +EOF + +test_expect_success 'Show all headers' ' + git send-email \ + --dry-run \ + --from="Example <from@example.com>" \ + --to=to@example.com \ + --cc=cc@example.com \ + --bcc=bcc@example.com \ + --in-reply-to="<unique-message-id@example.com>" \ + --smtp-server relay.example.com \ + $patches | + sed -e "s/^\(Date:\).*/\1 DATE-STRING/" \ + -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \ + -e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/" \ + >actual-show-all-headers && + diff -u expected-show-all-headers actual-show-all-headers +' + test_done |