aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neil@brown.name>2025-09-17 16:32:26 +1000
committerJunio C Hamano <gitster@pobox.com>2025-09-17 07:05:46 -0700
commitf448f65719686c78065f2900fbb342da7b4bc1ec (patch)
treecbda54a3831f8a8537dcc4bad1a7d1c4bd51978f
parentc44beea485f0f2feaf460e2ac87fdd5608d63cf0 (diff)
downloadgit-f448f65719686c78065f2900fbb342da7b4bc1ec.tar.xz
send-email: don't duplicate Reply-to: in intro message
If I run git send-email --compose --reply-to 'ME <my@address.net>' ..... and edit the intro message, then it will get two copies of the Reply-To field. gmail.com rejects such messages. This happens because send-email reads the edited message examining the headers. For recognised headers the content is extracted to use in constructing the final message and for possible inclusion in the patch emails. Unrecognised headers are gathered (in @xh) to be passed through uninterpreted. Unfortunately "Reply-To" is not recognised in this process so it is added to @xh as an uninterpreted header, but also generated from the $reply_to variable in gen_header(), resulting in two copies Add parsing to the loop in pre_process_file() to recognise a Reply-to header and to store the result in $reply_to. This means that the intro message will not get a second header and also means that any changes made to the Reply-To header during editing will be incorporated in the $reply_to variable and so included in all the generated email messages. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-send-email.perl3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 437f8ac46a..e2248c2231 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;