git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/6] send-email: fix non-threaded mails

From
Junio C Hamano <junio@pobox.com>
Date
Jun 10, 2009, 07:16 UTC
Message-ID
<7vr5xstv7m.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vhbyo1vr7.fsf@alter.siamese.dyndns.org>
From: Markus Heidelberg <markus.heidelberg@web.de>
Date: Mon, 8 Jun 2009 08:43:56 +0200

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 until commit 15da108 ("send-email: 'References:' should only reference what is sent", 2009-04-13), which introduced a regression with the side effect to make it possible again when --no-chain-reply-to was set.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * Applies on top of [1/6]
 git-send-email.perl   |    3 ++-
 t/t9001-send-email.sh |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index cccbf45..5d51697 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1137,7 +1137,8 @@ foreach my $t (@files) {
 	send_message();
 
 	# set up for the next message
-	if ($chain_reply_to || !defined $reply_to || length($reply_to) == 0) {
+	if ($thread &&
+		($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 5bfa36e..8518aca 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -621,7 +621,7 @@ test_expect_success 'in-reply-to but no threading' '
 	grep "In-Reply-To: <in-reply-id@example.com>"
 '
 
-test_expect_failure 'no in-reply-to and no threading' '
+test_expect_success 'no in-reply-to and no threading' '
 	git send-email \
 		--dry-run \
 		--from="Example <nobody@example.com>" \
-- 
1.6.3.2.214.gf4f78e
Previous: Junio C HamanoNext: Junio C Hamano
Message 27 of 38 in “fixes for git-send-email”
  1. 0/6 fixes for git-send-emailMarkus Heidelberg, Jun 7, 2009
  2. 1/6 send-email: fix a typo in a commentMarkus Heidelberg, Jun 7, 2009
  3. Junio C HamanoJun 8, 2009
  4. Markus HeidelbergJun 9, 2009
  5. 1/2 add a test for git-send-email for non-threaded mailsMarkus Heidelberg, Jun 9, 2009
  6. 2/2 send-email: fix non-threaded mailsMarkus Heidelberg, Jun 9, 2009
  7. 2/6 add a test for git-send-email for threaded mails without chain-reply-toMarkus Heidelberg, Jun 7, 2009
  8. Junio C HamanoJun 7, 2009
  9. Markus HeidelbergJun 8, 2009
  10. 2/6 add a test for git-send-email for threaded mails without chain-reply-toMarkus Heidelberg, Jun 8, 2009
  11. Junio C HamanoJun 8, 2009
  12. 3/6 send-email: fix threaded mails without chain-reply-toMarkus Heidelberg, Jun 7, 2009
  13. Junio C HamanoJun 10, 2009
  14. [RF sanity check] send-email threading fixes (was Re: [PATCH 3/6] send-email: fix threaded mails without chain-reply-to)Junio C Hamano, Jun 10, 2009
  15. Markus HeidelbergJun 11, 2009
  16. Junio C HamanoJun 11, 2009
  17. Markus HeidelbergJun 11, 2009
  18. Junio C HamanoJun 11, 2009
  19. 0/6 send-email threading fixesMarkus Heidelberg, Jun 12, 2009
  20. 1/6 add a test for git-send-email for non-threaded mailsMarkus Heidelberg, Jun 12, 2009
  21. 2/6 send-email: fix non-threaded mailsMarkus Heidelberg, Jun 12, 2009
  22. 3/6 doc/send-email: clarify the behavior of --in-reply-to with --no-threadMarkus Heidelberg, Jun 12, 2009
  23. 4/6 add a test for git-send-email for threaded mails without chain-reply-toMarkus Heidelberg, Jun 12, 2009
  24. 5/6 send-email: fix threaded mails without chain-reply-toMarkus Heidelberg, Jun 12, 2009
  25. 6/6 send-email: fix a typo in a commentMarkus Heidelberg, Jun 12, 2009
  26. 1/6 add a test for git-send-email for non-threaded mailsJunio C Hamano, Jun 10, 2009
  27. 2/6 send-email: fix non-threaded mailsJunio C Hamano, Jun 10, 2009
  28. 3/6 doc/send-email: clarify the behavior of --in-reply-to with --no-threadJunio C Hamano, Jun 10, 2009
  29. 4/6 send-email: fix threaded mails without chain-reply-toJunio C Hamano, Jun 10, 2009
  30. 5/6 add a test for git-send-email for threaded mails without chain-reply-toJunio C Hamano, Jun 10, 2009
  31. 6/6 send-email: fix a typo in a commentJunio C Hamano, Jun 10, 2009
  32. 4/6 add a test for git-send-email for non-threaded mailsMarkus Heidelberg, Jun 7, 2009
  33. Markus HeidelbergJun 8, 2009
  34. Junio C HamanoJun 8, 2009
  35. 4/6 add a test for git-send-email for non-threaded mailsMarkus Heidelberg, Jun 8, 2009
  36. 5/6 send-email: fix non-threaded mailsMarkus Heidelberg, Jun 7, 2009
  37. 5/6 send-email: fix non-threaded mailsMarkus Heidelberg, Jun 8, 2009
  38. 6/6 doc/send-email: clarify the behavior of --in-reply-to with --no-threadMarkus Heidelberg, Jun 7, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.