From f9f60d70663a89ff06fd38c806e47fc51f29ff72 Mon Sep 17 00:00:00 2001 From: Rafael Aquini Date: Mon, 29 Jun 2020 10:11:04 -0400 Subject: send-email: restore --in-reply-to superseding behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git send-email --in-reply-to= fails to override In-Reply-To email headers, if they're present in the output of format-patch, even when explicitly told to do so by the option --no-thread, which breaks the contract of the command line switch option, per its man page. " --in-reply-to= Make the first mail (or all the mails with --no-thread) appear as a reply to the given Message-Id, which avoids breaking threads to provide a new patch series. " This patch fixes the aformentioned issue, by bringing --in-reply-to's old overriding behavior back. The test was donated by Carlo Marcelo Arenas Belón. Signed-off-by: Rafael Aquini Helped-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- git-send-email.perl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'git-send-email.perl') diff --git a/git-send-email.perl b/git-send-email.perl index dc95656f75..36c47bae1d 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1699,10 +1699,14 @@ sub process_file { $xfer_encoding = $1 if not defined $xfer_encoding; } elsif (/^In-Reply-To: (.*)/i) { - $in_reply_to = $1; + if (!$initial_in_reply_to || $thread) { + $in_reply_to = $1; + } } elsif (/^References: (.*)/i) { - $references = $1; + if (!$initial_in_reply_to || $thread) { + $references = $1; + } } elsif (!/^Date:\s/i && /^[-A-Za-z]+:\s+\S/) { push @xh, $_; -- cgit v1.2.3