diff options
author | Stephen Boyd <bebarino@gmail.com> | 2010-09-29 00:26:44 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-29 13:24:04 -0700 |
commit | 21802cd32805b19fa32e8e3594ee3914733d53d3 (patch) | |
tree | 615b12bf77171b28bae6576fe9c558d221566f84 /t | |
parent | 442cb08fa0dca38c99cf1ff8a5654a95a5cad7a4 (diff) | |
download | git-21802cd32805b19fa32e8e3594ee3914733d53d3.tar.gz git-21802cd32805b19fa32e8e3594ee3914733d53d3.tar.xz |
send-email: Use To: headers in patch files
It's a minor annoyance when you take the painstaking time to setup To:
headers for each patch in a large series, and then go out to send the
series with git-send-email and watch git ignore the To: headers in the
patch files.
Therefore, always add To: headers from a patch file to the To: headers
for that message. Keep the prompt for the blanket To: header so as to
not break scripts (and user expectations). This means even if a patch
has a To: header, git will prompt for the To: address. Otherwise, we'll
need to introduce interface breakage to either request the header for
each patch missing a To: header or default the header to whatever To:
address is found first (be it in a patch or from user input). Both of
these options don't seem very obvious/useful.
Reported-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Tested-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t9001-send-email.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 71b3df9b5..294e31f7f 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -947,6 +947,30 @@ test_expect_success $PREREQ '--no-bcc overrides sendemail.bcc' ' ! grep "RCPT TO:<other@ex.com>" stdout ' +test_expect_success $PREREQ 'patches To headers are used by default' ' + patch=`git format-patch -1 --to="bodies@example.com"` && + test_when_finished "rm $patch" && + git send-email \ + --dry-run \ + --from="Example <nobody@example.com>" \ + --smtp-server relay.example.com \ + $patch >stdout && + grep "RCPT TO:<bodies@example.com>" stdout +' + +test_expect_success $PREREQ 'patches To headers are appended to' ' + patch=`git format-patch -1 --to="bodies@example.com"` && + test_when_finished "rm $patch" && + git send-email \ + --dry-run \ + --from="Example <nobody@example.com>" \ + --to=nobody@example.com \ + --smtp-server relay.example.com \ + $patch >stdout && + grep "RCPT TO:<bodies@example.com>" stdout && + grep "RCPT TO:<nobody@example.com>" stdout +' + test_expect_success $PREREQ 'setup expect' ' cat >email-using-8bit <<EOF From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001 |