Skip to content

Commit f448f65

Browse files
neilbrowngitster
authored andcommitted
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>
1 parent c44beea commit f448f65

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

git-send-email.perl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,6 +1931,9 @@ sub pre_process_file {
19311931
$in_reply_to = $1;
19321932
}
19331933
}
1934+
elsif (/^Reply-To: (.*)/i) {
1935+
$reply_to = $1;
1936+
}
19341937
elsif (/^References: (.*)/i) {
19351938
if (!$initial_in_reply_to || $thread) {
19361939
$references = $1;

0 commit comments

Comments
 (0)