summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorRafael Aquini <aquini@redhat.com>2020-06-29 14:11:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-01 23:12:21 (GMT)
commitf9f60d70663a89ff06fd38c806e47fc51f29ff72 (patch)
treef59bdbd0ad3a39b8f8dbb0be039a82b45619c951 /git-send-email.perl
parentaf6b65d45ef179ed52087e80cb089f6b2349f4ec (diff)
downloadgit-f9f60d70663a89ff06fd38c806e47fc51f29ff72.zip
git-f9f60d70663a89ff06fd38c806e47fc51f29ff72.tar.gz
git-f9f60d70663a89ff06fd38c806e47fc51f29ff72.tar.bz2
send-email: restore --in-reply-to superseding behavior
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=<identifier> 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 <aquini@redhat.com> Helped-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl8
1 files changed, 6 insertions, 2 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index dc95656..36c47ba 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, $_;