@matheusbsbs / matheus-bagliano / commits / 5e9758e296
Fork 0

send-email: fix non-threaded mails

After commit 3e0c4ff (send-email: respect in-reply-to regardless of threading, 2009-03-01) the variable $thread was only used for prompting for an "In-Reply-To", but not for controlling whether the "In-Reply-To" and "References" fields should be written into the email. Thus these fields were always used beginning with the second mail and it was not possible to produce non-threaded mails anymore. However, a later commit 15da108 ("send-email: 'References:' should only reference what is sent", 2009-04-13) introduced a regression with the side effect to make non-threaded mails possible again, but only when --no-chain-reply-to was used. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Markus Heidelberg committed Jun 12, 2009 at 12:51 UTC 5e9758e2968238906c730c9c77ecc95c21e7495e
2 files changed +3 -2
git-send-email.perl
+2 -1
@@ -1137,7 +1137,8 @@ foreach my $t (@files) {
1137 send_message();
1138
1139 # set up for the next message
1140 - if ($chain_reply_to || !defined $reply_to || length($reply_to) == 0) {
1140 + if ($thread &&
1141 + ($chain_reply_to || !defined $reply_to || length($reply_to) == 0)) {
1142 $reply_to = $message_id;
1143 if (length $references > 0) {
1144 $references .= "\n $message_id";
t/t9001-send-email.sh
+1 -1
@@ -621,7 +621,7 @@ test_expect_success 'in-reply-to but no threading' '
621 grep "In-Reply-To: <in-reply-id@example.com>"
622 '
623
624 -test_expect_failure 'no in-reply-to and no threading' '
624 +test_expect_success 'no in-reply-to and no threading' '
625 git send-email \
626 --dry-run \
627 --from="Example <nobody@example.com>" \