aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-11-29 09:55:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-11 17:21:43 +0000
commited9e0b8aafe880cc3d6de2ac45acb67e65bc9314 (patch)
treee94f0a960587f323384cb339453513bc00065072
parent926f3dfe2dfe98e220b1709e57982c7aa154b5ae (diff)
downloadopenembedded-core-contrib-ed9e0b8aafe880cc3d6de2ac45acb67e65bc9314.tar.gz
scripts/send-pull-request: Avoid multiple chain headers
When creating a patch set with cover letter using the send-pull-request script, both the "In-Reply-To" and "References" headers are appended twice in patch 2 and subsequent. That's because git-format-patch already inserted them and then git-send-email repeats that. Suppressing mail threading in git-send-email with --no-thread avoids the problem and is the right solution because it works regardless whether git-send-email is called once or twicee. Repeating these headers is a violation of RFC 2822 and can confuse mail programs. For example, Patchwork does not detect a patch series problem when there are these extra headers. [YOCTO #10718] (From OE-Core rev: 303a1aa3df43eb0b693d8602062fa33c4a08fdd6) (From OE-Core rev: 025d21b856e650c8edefd2d06493e84f8416d50f) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/send-pull-request9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/send-pull-request b/scripts/send-pull-request
index 575549db38..883deacb07 100755
--- a/scripts/send-pull-request
+++ b/scripts/send-pull-request
@@ -158,11 +158,16 @@ GIT_EXTRA_CC=$(for R in $EXTRA_CC; do echo -n "--cc='$R' "; done)
unset IFS
# Handoff to git-send-email. It will perform the send confirmation.
+# Mail threading was already handled by git-format-patch in
+# create-pull-request, so we must not allow git-send-email to
+# add In-Reply-To and References headers again.
PATCHES=$(echo $PDIR/*.patch)
if [ $AUTO_CL -eq 1 ]; then
# Send the cover letter to every recipient, both specified as well as
# harvested. Then remove it from the patches list.
- eval "git send-email $GIT_TO $GIT_CC $GIT_EXTRA_CC --confirm=always --no-chain-reply-to --suppress-cc=all $CL"
+ # --no-thread is redundant here (only sending a single message) and
+ # merely added for the sake of consistency.
+ eval "git send-email $GIT_TO $GIT_CC $GIT_EXTRA_CC --confirm=always --no-thread --suppress-cc=all $CL"
if [ $? -eq 1 ]; then
echo "ERROR: failed to send cover-letter with automatic recipients."
exit 1
@@ -172,7 +177,7 @@ fi
# Send the patch to the specified recipients and, if -c was specified, those git
# finds in this specific patch.
-eval "git send-email $GIT_TO $GIT_EXTRA_CC --confirm=always --no-chain-reply-to $GITSOBCC $PATCHES"
+eval "git send-email $GIT_TO $GIT_EXTRA_CC --confirm=always --no-thread $GITSOBCC $PATCHES"
if [ $? -eq 1 ]; then
echo "ERROR: failed to send patches."
exit 1