mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
rebase --preserve-merges: ignore "merge.log" config
When "merge.log" config is set, "rebase --preserve-merges" will add the log lines to the message of the rebased merge commit. A rebase should not modify a commit message automatically. Teach "git-rebase" to ignore that configuration by passing "--no-log" to the git-merge call. Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
4d06473928
commit
a9f739c111
|
@ -352,8 +352,9 @@ pick_one_preserving_merges () {
|
||||||
msg_content="$(commit_message $sha1)"
|
msg_content="$(commit_message $sha1)"
|
||||||
# No point in merging the first parent, that's HEAD
|
# No point in merging the first parent, that's HEAD
|
||||||
new_parents=${new_parents# $first_parent}
|
new_parents=${new_parents# $first_parent}
|
||||||
|
merge_args="--no-log --no-ff"
|
||||||
if ! do_with_author output eval \
|
if ! do_with_author output eval \
|
||||||
'git merge --no-ff $strategy_args -m "$msg_content" $new_parents'
|
'git merge $merge_args $strategy_args -m "$msg_content" $new_parents'
|
||||||
then
|
then
|
||||||
printf "%s\n" "$msg_content" > "$GIT_DIR"/MERGE_MSG
|
printf "%s\n" "$msg_content" > "$GIT_DIR"/MERGE_MSG
|
||||||
die_with_patch $sha1 "Error redoing merge $sha1"
|
die_with_patch $sha1 "Error redoing merge $sha1"
|
||||||
|
|
|
@ -28,6 +28,8 @@ export GIT_AUTHOR_EMAIL
|
||||||
# \--A3 <-- topic2
|
# \--A3 <-- topic2
|
||||||
# \
|
# \
|
||||||
# B2 <-- origin/topic
|
# B2 <-- origin/topic
|
||||||
|
#
|
||||||
|
# Clone 4 (same as Clone 3)
|
||||||
|
|
||||||
test_expect_success 'setup for merge-preserving rebase' \
|
test_expect_success 'setup for merge-preserving rebase' \
|
||||||
'echo First > A &&
|
'echo First > A &&
|
||||||
|
@ -64,6 +66,16 @@ test_expect_success 'setup for merge-preserving rebase' \
|
||||||
git merge --no-ff topic2
|
git merge --no-ff topic2
|
||||||
) &&
|
) &&
|
||||||
|
|
||||||
|
git clone ./. clone4 &&
|
||||||
|
(
|
||||||
|
cd clone4 &&
|
||||||
|
git checkout -b topic2 origin/topic &&
|
||||||
|
echo Sixth > A &&
|
||||||
|
git commit -a -m "Modify A3" &&
|
||||||
|
git checkout -b topic origin/topic &&
|
||||||
|
git merge --no-ff topic2
|
||||||
|
) &&
|
||||||
|
|
||||||
git checkout topic &&
|
git checkout topic &&
|
||||||
echo Fourth >> B &&
|
echo Fourth >> B &&
|
||||||
git commit -a -m "Modify B2"
|
git commit -a -m "Modify B2"
|
||||||
|
@ -96,4 +108,15 @@ test_expect_success 'rebase -p preserves no-ff merges' '
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'rebase -p ignores merge.log config' '
|
||||||
|
(
|
||||||
|
cd clone4 &&
|
||||||
|
git fetch &&
|
||||||
|
git -c merge.log=1 rebase -p origin/topic &&
|
||||||
|
echo >expected &&
|
||||||
|
git log --format="%b" -1 >current &&
|
||||||
|
test_cmp expected current
|
||||||
|
)
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in a new issue