aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-06-13 12:55:50 -0700
committerJunio C Hamano <gitster@pobox.com>2009-06-13 12:55:50 -0700
commit08ba24898a1c5c0815450d481d8e5d01bf671642 (patch)
tree9b06143e91f1ef45194210066e955863f0ea12ad
parente2486193c54e5404bad1748d220f58a414867797 (diff)
parent95a877a34c3838a92a99794ebc3b082f6f525899 (diff)
downloadgit-08ba24898a1c5c0815450d481d8e5d01bf671642.tar.gz
git-08ba24898a1c5c0815450d481d8e5d01bf671642.tar.xz
Merge branch 'mh/fix-send-email-threaded'
* mh/fix-send-email-threaded: send-email: fix a typo in a comment send-email: fix threaded mails without chain-reply-to add a test for git-send-email for threaded mails without chain-reply-to doc/send-email: clarify the behavior of --in-reply-to with --no-thread send-email: fix non-threaded mails add a test for git-send-email for non-threaded mails
-rw-r--r--Documentation/git-send-email.txt5
-rwxr-xr-xgit-send-email.perl5
-rwxr-xr-xt/t9001-send-email.sh21
3 files changed, 27 insertions, 4 deletions
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index e7cb0e6c7..9902da43c 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -165,7 +165,7 @@ Automating
Output of this command must be single email address per line.
Default is the value of 'sendemail.cccmd' configuration value.
---[no-]chain-reply-to=<identifier>::
+--[no-]chain-reply-to::
If this is set, each email will be sent as a reply to the previous
email sent. If disabled with "--no-chain-reply-to", all emails after
the first will be sent as replies to the first email sent. When using
@@ -214,7 +214,8 @@ specified, as well as 'body' if --no-signed-off-cc is specified.
--[no-]thread::
If this is set, the In-Reply-To header will be set on each email sent.
If disabled with "--no-thread", no emails will have the In-Reply-To
- header set. Default is the value of the 'sendemail.thread' configuration
+ header set, unless specified with --in-reply-to.
+ Default is the value of the 'sendemail.thread' configuration
value; if that is unspecified, default to --thread.
diff --git a/git-send-email.perl b/git-send-email.perl
index 4c795a4b0..303e03a8c 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -812,7 +812,7 @@ sub sanitize_address
}
# Returns 1 if the message was sent, and 0 otherwise.
-# In actuality, the whole program dies when a there
+# In actuality, the whole program dies when there
# is an error sending a message.
sub send_message
@@ -1150,7 +1150,8 @@ foreach my $t (@files) {
my $message_was_sent = send_message();
# set up for the next message
- if ($message_was_sent and $chain_reply_to || not defined $reply_to || length($reply_to) == 0) {
+ if ($thread && $message_was_sent &&
+ ($chain_reply_to || !defined $reply_to || length($reply_to) == 0)) {
$reply_to = $message_id;
if (length $references > 0) {
$references .= "\n $message_id";
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 2ce24cd5a..9ce04fd47 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -621,4 +621,25 @@ test_expect_success 'in-reply-to but no threading' '
grep "In-Reply-To: <in-reply-id@example.com>"
'
+test_expect_success 'no in-reply-to and no threading' '
+ git send-email \
+ --dry-run \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --nothread \
+ $patches $patches >stdout &&
+ ! grep "In-Reply-To: " stdout
+'
+
+test_expect_success 'threading but no chain-reply-to' '
+ git send-email \
+ --dry-run \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --thread \
+ --nochain-reply-to \
+ $patches $patches >stdout &&
+ grep "In-Reply-To: " stdout
+'
+
test_done