Skip to content

Commit 9a3a02b

Browse files
committed
Merge branch 'rt/rebase-p-no-merge-summary' into maint
* rt/rebase-p-no-merge-summary: rebase --preserve-merges: ignore "merge.log" config
2 parents 6f89c27 + a9f739c commit 9a3a02b

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

git-rebase--interactive.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,9 @@ pick_one_preserving_merges () {
352352
msg_content="$(commit_message $sha1)"
353353
# No point in merging the first parent, that's HEAD
354354
new_parents=${new_parents# $first_parent}
355+
merge_args="--no-log --no-ff"
355356
if ! do_with_author output eval \
356-
'git merge --no-ff $strategy_args -m "$msg_content" $new_parents'
357+
'git merge $merge_args $strategy_args -m "$msg_content" $new_parents'
357358
then
358359
printf "%s\n" "$msg_content" > "$GIT_DIR"/MERGE_MSG
359360
die_with_patch $sha1 "Error redoing merge $sha1"

t/t3409-rebase-preserve-merges.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export GIT_AUTHOR_EMAIL
2828
# \--A3 <-- topic2
2929
# \
3030
# B2 <-- origin/topic
31+
#
32+
# Clone 4 (same as Clone 3)
3133

3234
test_expect_success 'setup for merge-preserving rebase' \
3335
'echo First > A &&
@@ -64,6 +66,16 @@ test_expect_success 'setup for merge-preserving rebase' \
6466
git merge --no-ff topic2
6567
) &&
6668
69+
git clone ./. clone4 &&
70+
(
71+
cd clone4 &&
72+
git checkout -b topic2 origin/topic &&
73+
echo Sixth > A &&
74+
git commit -a -m "Modify A3" &&
75+
git checkout -b topic origin/topic &&
76+
git merge --no-ff topic2
77+
) &&
78+
6779
git checkout topic &&
6880
echo Fourth >> B &&
6981
git commit -a -m "Modify B2"
@@ -96,4 +108,15 @@ test_expect_success 'rebase -p preserves no-ff merges' '
96108
)
97109
'
98110

111+
test_expect_success 'rebase -p ignores merge.log config' '
112+
(
113+
cd clone4 &&
114+
git fetch &&
115+
git -c merge.log=1 rebase -p origin/topic &&
116+
echo >expected &&
117+
git log --format="%b" -1 >current &&
118+
test_cmp expected current
119+
)
120+
'
121+
99122
test_done

0 commit comments

Comments
 (0)