rebase: use mboxrd format to avoid split errors
The mboxrd format allows the use of embedded "From " lines in commit messages without being misinterpreted by mailsplit Reported-by: Florian Weimer <fweimer@redhat.com> Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
5a1f5c3060
commit
ae3b2b04bb
|
@ -53,6 +53,7 @@ else
|
||||||
|
|
||||||
git format-patch -k --stdout --full-index --cherry-pick --right-only \
|
git format-patch -k --stdout --full-index --cherry-pick --right-only \
|
||||||
--src-prefix=a/ --dst-prefix=b/ --no-renames --no-cover-letter \
|
--src-prefix=a/ --dst-prefix=b/ --no-renames --no-cover-letter \
|
||||||
|
--pretty=mboxrd \
|
||||||
$git_format_patch_opt \
|
$git_format_patch_opt \
|
||||||
"$revisions" ${restrict_revision+^$restrict_revision} \
|
"$revisions" ${restrict_revision+^$restrict_revision} \
|
||||||
>"$GIT_DIR/rebased-patches"
|
>"$GIT_DIR/rebased-patches"
|
||||||
|
@ -83,6 +84,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git am $git_am_opt --rebasing --resolvemsg="$resolvemsg" \
|
git am $git_am_opt --rebasing --resolvemsg="$resolvemsg" \
|
||||||
|
--patch-format=mboxrd \
|
||||||
$allow_rerere_autoupdate \
|
$allow_rerere_autoupdate \
|
||||||
${gpg_sign_opt:+"$gpg_sign_opt"} <"$GIT_DIR/rebased-patches"
|
${gpg_sign_opt:+"$gpg_sign_opt"} <"$GIT_DIR/rebased-patches"
|
||||||
ret=$?
|
ret=$?
|
||||||
|
|
|
@ -255,4 +255,26 @@ test_expect_success 'rebase commit with an ancient timestamp' '
|
||||||
grep "author .* 34567 +0600$" actual
|
grep "author .* 34567 +0600$" actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'rebase with "From " line in commit message' '
|
||||||
|
git checkout -b preserve-from master~1 &&
|
||||||
|
cat >From_.msg <<EOF &&
|
||||||
|
Somebody embedded an mbox in a commit message
|
||||||
|
|
||||||
|
This is from so-and-so:
|
||||||
|
|
||||||
|
From a@b Mon Sep 17 00:00:00 2001
|
||||||
|
From: John Doe <nobody@example.com>
|
||||||
|
Date: Sat, 11 Nov 2017 00:00:00 +0000
|
||||||
|
Subject: not this message
|
||||||
|
|
||||||
|
something
|
||||||
|
EOF
|
||||||
|
>From_ &&
|
||||||
|
git add From_ &&
|
||||||
|
git commit -F From_.msg &&
|
||||||
|
git rebase master &&
|
||||||
|
git log -1 --pretty=format:%B >out &&
|
||||||
|
test_cmp From_.msg out
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in New Issue