Merge branch 'mh/maint-fix-send-email-threaded' into mh/fix-send-email-threaded
authorJunio C Hamano <gitster@pobox.com>
Fri, 12 Jun 2009 16:23:43 +0000 (09:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Jun 2009 16:23:43 +0000 (09:23 -0700)
* 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

Documentation/git-send-email.txt
git-send-email.perl
t/t9001-send-email.sh
index e7cb0e6c71e84c896ecf2d232c906c5cb0de6b08..9902da43c7c24342346f2fcdce86c8db9411b28d 100644 (file)
@@ -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.
 
 
index 4a77d445cd5e7c8ffe894da429b7e63ed7aabe8f..303e03a8ce4031a1d9d6d00cb67abda1c30a63f3 100755 (executable)
@@ -1150,7 +1150,7 @@ sub send_message
        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) {
index 8ab1a78bf59e063ca57bcee0bbf26edba0bec9ce..9ce04fd47277e1641979eb583a95de41e2f75570 100755 (executable)
@@ -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 \