File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed 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).
310
310
-p::
311
311
--preserve-merges::
312
312
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
+
313
318
314
319
--root::
315
320
Rebase all commits reachable from <branch>, instead of
@@ -611,6 +616,28 @@ The ripple effect of a "hard case" recovery is especially bad:
611
616
case" recovery too!
612
617
613
618
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
+
614
641
Authors
615
642
------
616
643
Written by Junio C Hamano <
[email protected] > and
Original file line number Diff line number Diff line change @@ -181,6 +181,12 @@ test_expect_success '-p handles "no changes" gracefully' '
181
181
test $HEAD = $(git rev-parse HEAD)
182
182
'
183
183
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
+
184
190
test_expect_success ' preserve merges with -p' '
185
191
git checkout -b to-be-preserved master^ &&
186
192
: > unrelated-file &&
You can’t perform that action at this time.
0 commit comments