File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -310,6 +310,11 @@ link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To] for details).
310310-p::
311311--preserve-merges::
312312 Instead of ignoring merges, try to recreate them.
313+ +
314+ This uses the `--interactive` machinery internally, but combining it
315+ with the `--interactive` option explicitly is generally not a good
316+ idea unless you know what you are doing (see BUGS below).
317+
313318
314319--root::
315320 Rebase all commits reachable from <branch>, instead of
@@ -611,6 +616,28 @@ The ripple effect of a "hard case" recovery is especially bad:
611616case" recovery too!
612617
613618
619+ BUGS
620+ ----
621+ The todo list presented by `--preserve-merges --interactive` does not
622+ represent the topology of the revision graph. Editing commits and
623+ rewording their commit messages should work fine, but attempts to
624+ reorder commits tend to produce counterintuitive results.
625+
626+ For example, an attempt to rearrange
627+ ------------
628+ 1 --- 2 --- 3 --- 4 --- 5
629+ ------------
630+ to
631+ ------------
632+ 1 --- 2 --- 4 --- 3 --- 5
633+ ------------
634+ by moving the "pick 4" line will result in the following history:
635+ ------------
636+ 3
637+ /
638+ 1 --- 2 --- 4 --- 5
639+ ------------
640+
614641Authors
615642------
616643Written by Junio C Hamano <gitster@pobox.com> and
Original file line number Diff line number Diff line change @@ -181,6 +181,12 @@ test_expect_success '-p handles "no changes" gracefully' '
181181 test $HEAD = $(git rev-parse HEAD)
182182'
183183
184+ test_expect_failure ' exchange two commits with -p' '
185+ FAKE_LINES="2 1" git rebase -i -p HEAD~2 &&
186+ test H = $(git cat-file commit HEAD^ | sed -ne \$p) &&
187+ test G = $(git cat-file commit HEAD | sed -ne \$p)
188+ '
189+
184190test_expect_success ' preserve merges with -p' '
185191 git checkout -b to-be-preserved master^ &&
186192 : > unrelated-file &&
You can’t perform that action at this time.
0 commit comments