git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] send-email: restore --in-reply-to superseding behavior
@ 2020-06-24 19:55 Rafael Aquini
  2020-06-24 21:33 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Rafael Aquini @ 2020-06-24 19:55 UTC (permalink / raw)
  To: git

git send-email --in-reply-to= fails to override the email headers,
if they're present in the output of format-patch, which breakes the
contract of the command line switch. This can cause an email thread to
break, if subsequent replies to a given message need to be sent after
amending fixes to a commit and re-running git format-patch to get the
incremental patch-fix posted.

Fixes: 256be1d3f0 (send-email: avoid duplicate In-Reply-To/References, 2018-04-17)
Signed-off-by: Rafael Aquini <aquini@redhat.com>
---
 git-send-email.perl | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index dc95656f75..342e00b1f3 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) {
+					$in_reply_to = $1;
+				}
 			}
 			elsif (/^References: (.*)/i) {
-				$references = $1;
+				if (!$initial_in_reply_to) {
+					$references = $1;
+				}
 			}
 			elsif (!/^Date:\s/i && /^[-A-Za-z]+:\s+\S/) {
 				push @xh, $_;
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-07-01 22:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24 19:55 [PATCH] send-email: restore --in-reply-to superseding behavior Rafael Aquini
2020-06-24 21:33 ` Junio C Hamano
2020-06-24 23:45   ` Rafael Aquini
2020-06-25 18:47     ` Rafael Aquini
2020-06-26  1:08       ` Carlo Arenas
2020-06-26 13:39         ` Rafael Aquini
2020-06-29 14:11   ` [PATCH v2] " Rafael Aquini
2020-07-01 22:10     ` Carlo Marcelo Arenas Belón

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).