diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-06-12 09:23:43 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-06-12 09:23:43 -0700 |
commit | 95a877a34c3838a92a99794ebc3b082f6f525899 (patch) | |
tree | bcd7961c64ef7d319e75b7dc320235881efd1e69 | |
parent | send-email: fix a typo in a comment (diff) | |
parent | doc/send-email: clarify the behavior of --in-reply-to with --no-thread (diff) | |
download | tgif-95a877a34c3838a92a99794ebc3b082f6f525899.tar.xz |
Merge branch 'mh/maint-fix-send-email-threaded' into mh/fix-send-email-threaded
* mh/maint-fix-send-email-threaded:
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
Conflicts:
git-send-email.perl
t/t9001-send-email.sh
-rw-r--r-- | Documentation/git-send-email.txt | 5 | ||||
-rwxr-xr-x | git-send-email.perl | 2 | ||||
-rwxr-xr-x | t/t9001-send-email.sh | 10 |
3 files changed, 14 insertions, 3 deletions
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt index e7cb0e6c71..9902da43c7 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 4a77d445cd..303e03a8ce 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1150,7 +1150,7 @@ foreach my $t (@files) { my $message_was_sent = send_message(); # set up for the next message - if ($message_was_sent && + if ($thread && $message_was_sent && ($chain_reply_to || !defined $reply_to || length($reply_to) == 0)) { $reply_to = $message_id; if (length $references > 0) { diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 8ab1a78bf5..9ce04fd472 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -621,6 +621,16 @@ 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 \ |