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

[PATCH] send-email: don't duplicate Reply-to:

From
NNeilBrown <neilb@ownmail.net>
Date
Sep 15, 2025, 04:12 UTC
Message-ID
<175790952167.1696783.4795702220839036460@noble.neil.brown.name>
If I run
  git send-email --compose --reply-to 'ME <my@address.net>' .....

and edit the intro message, then the message will get two copies of the Reply-To field. gmail.com rejects such messages.

This happens because a Reply-To is inserted into the intro message template, and then the intro message headers are copied and another Reply-to is added.

This patch fixes the problem by noticing the Reply-To: header when the intro is parsed, and using it to assign $reply_to rather than blindly coping it into the new headers.

Signed-off-by: NeilBrown <neil@brown.name>
---
 git-send-email.perl | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/git-send-email.perl b/git-send-email.perl
index 437f8ac46a85..e2248c223119 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1931,6 +1931,9 @@ sub pre_process_file {
 					$in_reply_to = $1;
 				}
 			}
+			elsif (/^Reply-To: (.*)/i) {
+				$reply_to = $1;
+			}
 			elsif (/^References: (.*)/i) {
 				if (!$initial_in_reply_to || $thread) {
 					$references = $1;
-- 
2.50.0.107.gf914562f5916.dirty
Next: Junio C Hamano
Message 1 of 3 in “send-email: don't duplicate Reply-to:”
  1. send-email: don't duplicate Reply-to:NeilBrown, Sep 15, 2025
  2. Junio C HamanoSep 16, 2025
  3. NeilBrownSep 17, 2025

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.