tests: stop testing `git rebase --preserve-merges`

This backend has been deprecated in favor of `git rebase --rebase-merges`. In preparation for dropping it, let's remove all the regression tests that would need it. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Sep 7, 2021 at 21:05 UTC aa4df107e72a7a8bd2f149ecb58edfe9dde8576b
17 files changed +3 -764
.github/workflows/main.yml
-1
@@ -198,7 +198,6 @@ jobs:
198 shell: bash
199 env:
200 NO_SVN_TESTS: 1
201 - GIT_TEST_SKIP_REBASE_P: 1
201 run: ci/run-test-slice.sh ${{matrix.nr}} 10
202 - name: ci/print-test-failures.sh
203 if: failure()
t/t3404-rebase-interactive.sh
-76
@@ -351,82 +351,6 @@ test_expect_success 'retain authorship when squashing' '
351 git show HEAD | grep "^Author: Twerp Snog"
352 '
353
354 -test_expect_success REBASE_P '-p handles "no changes" gracefully' '
355 - HEAD=$(git rev-parse HEAD) &&
356 - git rebase -i -p HEAD^ &&
357 - git update-index --refresh &&
358 - git diff-files --quiet &&
359 - git diff-index --quiet --cached HEAD -- &&
360 - test $HEAD = $(git rev-parse HEAD)
361 -'
362 -
363 -test_expect_failure REBASE_P 'exchange two commits with -p' '
364 - git checkout H &&
365 - (
366 - set_fake_editor &&
367 - FAKE_LINES="2 1" git rebase -i -p HEAD~2
368 - ) &&
369 - test H = $(git cat-file commit HEAD^ | sed -ne \$p) &&
370 - test G = $(git cat-file commit HEAD | sed -ne \$p)
371 -'
372 -
373 -test_expect_success REBASE_P 'preserve merges with -p' '
374 - git checkout -b to-be-preserved primary^ &&
375 - : > unrelated-file &&
376 - git add unrelated-file &&
377 - test_tick &&
378 - git commit -m "unrelated" &&
379 - git checkout -b another-branch primary &&
380 - echo B > file1 &&
381 - test_tick &&
382 - git commit -m J file1 &&
383 - test_tick &&
384 - git merge to-be-preserved &&
385 - echo C > file1 &&
386 - test_tick &&
387 - git commit -m K file1 &&
388 - echo D > file1 &&
389 - test_tick &&
390 - git commit -m L1 file1 &&
391 - git checkout HEAD^ &&
392 - echo 1 > unrelated-file &&
393 - test_tick &&
394 - git commit -m L2 unrelated-file &&
395 - test_tick &&
396 - git merge another-branch &&
397 - echo E > file1 &&
398 - test_tick &&
399 - git commit -m M file1 &&
400 - git checkout -b to-be-rebased &&
401 - test_tick &&
402 - git rebase -i -p --onto branch1 primary &&
403 - git update-index --refresh &&
404 - git diff-files --quiet &&
405 - git diff-index --quiet --cached HEAD -- &&
406 - test_cmp_rev HEAD~6 branch1 &&
407 - test_cmp_rev HEAD~4^2 to-be-preserved &&
408 - test_cmp_rev HEAD^^2^ HEAD^^^ &&
409 - test $(git show HEAD~5:file1) = B &&
410 - test $(git show HEAD~3:file1) = C &&
411 - test $(git show HEAD:file1) = E &&
412 - test $(git show HEAD:unrelated-file) = 1
413 -'
414 -
415 -test_expect_success REBASE_P 'edit ancestor with -p' '
416 - (
417 - set_fake_editor &&
418 - FAKE_LINES="1 2 edit 3 4" git rebase -i -p HEAD~3
419 - ) &&
420 - echo 2 > unrelated-file &&
421 - test_tick &&
422 - git commit -m L2-modified --amend unrelated-file &&
423 - git rebase --continue &&
424 - git update-index --refresh &&
425 - git diff-files --quiet &&
426 - git diff-index --quiet --cached HEAD -- &&
427 - test $(git show HEAD:unrelated-file) = 2
428 -'
429 -
354 test_expect_success '--continue tries to commit' '
355 git reset --hard D &&
356 test_tick &&
t/t3408-rebase-multi-line.sh
-10
@@ -55,14 +55,4 @@ test_expect_success rebase '
55 test_cmp expect actual
56
57 '
58 -test_expect_success REBASE_P rebasep '
59 -
60 - git checkout side-merge &&
61 - git rebase -p side &&
62 - git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
63 - git cat-file commit side-merge-original | sed -e "1,/^\$/d" >expect &&
64 - test_cmp expect actual
65 -
66 -'
67 -
58 test_done
t/t3409-rebase-preserve-merges.sh deleted
-130
@@ -1,130 +0,0 @@
1 -#!/bin/sh
2 -#
3 -# Copyright(C) 2008 Stephen Habermann & Andreas Ericsson
4 -#
5 -test_description='git rebase -p should preserve merges
6 -
7 -Run "git rebase -p" and check that merges are properly carried along
8 -'
9 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
10 -export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
11 -
12 -. ./test-lib.sh
13 -
14 -if ! test_have_prereq REBASE_P; then
15 - skip_all='skipping git rebase -p tests, as asked for'
16 - test_done
17 -fi
18 -
19 -GIT_AUTHOR_EMAIL=bogus_email_address
20 -export GIT_AUTHOR_EMAIL
21 -
22 -# Clone 2 (conflicting merge):
23 -#
24 -# A1--A2--B3 <-- origin/main
25 -# \ \
26 -# B1------M <-- topic
27 -# \
28 -# B2 <-- origin/topic
29 -#
30 -# Clone 3 (no-ff merge):
31 -#
32 -# A1--A2--B3 <-- origin/main
33 -# \
34 -# B1------M <-- topic
35 -# \ /
36 -# \--A3 <-- topic2
37 -# \
38 -# B2 <-- origin/topic
39 -#
40 -# Clone 4 (same as Clone 3)
41 -
42 -test_expect_success 'setup for merge-preserving rebase' \
43 - 'echo First > A &&
44 - git add A &&
45 - git commit -m "Add A1" &&
46 - git checkout -b topic &&
47 - echo Second > B &&
48 - git add B &&
49 - git commit -m "Add B1" &&
50 - git checkout -f main &&
51 - echo Third >> A &&
52 - git commit -a -m "Modify A2" &&
53 - echo Fifth > B &&
54 - git add B &&
55 - git commit -m "Add different B" &&
56 -
57 - git clone ./. clone2 &&
58 - (
59 - cd clone2 &&
60 - git checkout -b topic origin/topic &&
61 - test_must_fail git merge origin/main &&
62 - echo Resolved >B &&
63 - git add B &&
64 - git commit -m "Merge origin/main into topic"
65 - ) &&
66 -
67 - git clone ./. clone3 &&
68 - (
69 - cd clone3 &&
70 - git checkout -b topic2 origin/topic &&
71 - echo Sixth > A &&
72 - git commit -a -m "Modify A3" &&
73 - git checkout -b topic origin/topic &&
74 - git merge --no-ff topic2
75 - ) &&
76 -
77 - git clone ./. clone4 &&
78 - (
79 - cd clone4 &&
80 - git checkout -b topic2 origin/topic &&
81 - echo Sixth > A &&
82 - git commit -a -m "Modify A3" &&
83 - git checkout -b topic origin/topic &&
84 - git merge --no-ff topic2
85 - ) &&
86 -
87 - git checkout topic &&
88 - echo Fourth >> B &&
89 - git commit -a -m "Modify B2"
90 -'
91 -
92 -test_expect_success '--continue works after a conflict' '
93 - (
94 - cd clone2 &&
95 - git fetch &&
96 - test_must_fail git rebase -p origin/topic &&
97 - test 2 = $(git ls-files B | wc -l) &&
98 - echo Resolved again > B &&
99 - test_must_fail git rebase --continue &&
100 - grep "^@@@ " .git/rebase-merge/patch &&
101 - git add B &&
102 - git rebase --continue &&
103 - test 1 = $(git rev-list --all --pretty=oneline | grep "Modify A" | wc -l) &&
104 - test 1 = $(git rev-list --all --pretty=oneline | grep "Add different" | wc -l) &&
105 - test 1 = $(git rev-list --all --pretty=oneline | grep "Merge origin" | wc -l)
106 - )
107 -'
108 -
109 -test_expect_success 'rebase -p preserves no-ff merges' '
110 - (
111 - cd clone3 &&
112 - git fetch &&
113 - git rebase -p origin/topic &&
114 - test 3 = $(git rev-list --all --pretty=oneline | grep "Modify A" | wc -l) &&
115 - test 1 = $(git rev-list --all --pretty=oneline | grep "Merge branch" | wc -l)
116 - )
117 -'
118 -
119 -test_expect_success 'rebase -p ignores merge.log config' '
120 - (
121 - cd clone4 &&
122 - git fetch &&
123 - git -c merge.log=1 rebase -p origin/topic &&
124 - echo >expected &&
125 - git log --format="%b" -1 >current &&
126 - test_cmp expected current
127 - )
128 -'
129 -
130 -test_done
t/t3410-rebase-preserve-dropped-merges.sh deleted
-90
@@ -1,90 +0,0 @@
1 -#!/bin/sh
2 -#
3 -# Copyright (c) 2008 Stephen Haberman
4 -#
5 -
6 -test_description='git rebase preserve merges
7 -
8 -This test runs git rebase with preserve merges and ensures commits
9 -dropped by the --cherry-pick flag have their childrens parents
10 -rewritten.
11 -'
12 -. ./test-lib.sh
13 -
14 -if ! test_have_prereq REBASE_P; then
15 - skip_all='skipping git rebase -p tests, as asked for'
16 - test_done
17 -fi
18 -
19 -# set up two branches like this:
20 -#
21 -# A - B - C - D - E
22 -# \
23 -# F - G - H
24 -# \
25 -# I
26 -#
27 -# where B, D and G touch the same file.
28 -
29 -test_expect_success 'setup' '
30 - test_commit A file1 &&
31 - test_commit B file1 1 &&
32 - test_commit C file2 &&
33 - test_commit D file1 2 &&
34 - test_commit E file3 &&
35 - git checkout A &&
36 - test_commit F file4 &&
37 - test_commit G file1 3 &&
38 - test_commit H file5 &&
39 - git checkout F &&
40 - test_commit I file6
41 -'
42 -
43 -# A - B - C - D - E
44 -# \ \ \
45 -# F - G - H -- L \ --> L
46 -# \ | \
47 -# I -- G2 -- J -- K I -- K
48 -# G2 = same changes as G
49 -test_expect_success 'skip same-resolution merges with -p' '
50 - git checkout H &&
51 - test_must_fail git merge E &&
52 - test_commit L file1 23 &&
53 - git checkout I &&
54 - test_commit G2 file1 3 &&
55 - test_must_fail git merge E &&
56 - test_commit J file1 23 &&
57 - test_commit K file7 file7 &&
58 - git rebase -i -p L &&
59 - test $(git rev-parse HEAD^^) = $(git rev-parse L) &&
60 - test "23" = "$(cat file1)" &&
61 - test "I" = "$(cat file6)" &&
62 - test "file7" = "$(cat file7)"
63 -'
64 -
65 -# A - B - C - D - E
66 -# \ \ \
67 -# F - G - H -- L2 \ --> L2
68 -# \ | \
69 -# I -- G3 --- J2 -- K2 I -- G3 -- K2
70 -# G2 = different changes as G
71 -test_expect_success 'keep different-resolution merges with -p' '
72 - git checkout H &&
73 - test_must_fail git merge E &&
74 - test_commit L2 file1 23 &&
75 - git checkout I &&
76 - test_commit G3 file1 4 &&
77 - test_must_fail git merge E &&
78 - test_commit J2 file1 24 &&
79 - test_commit K2 file7 file7 &&
80 - test_must_fail git rebase -i -p L2 &&
81 - echo 234 > file1 &&
82 - git add file1 &&
83 - git rebase --continue &&
84 - test $(git rev-parse HEAD^^^) = $(git rev-parse L2) &&
85 - test "234" = "$(cat file1)" &&
86 - test "I" = "$(cat file6)" &&
87 - test "file7" = "$(cat file7)"
88 -'
89 -
90 -test_done
t/t3411-rebase-preserve-around-merges.sh deleted
-80
@@ -1,80 +0,0 @@
1 -#!/bin/sh
2 -#
3 -# Copyright (c) 2008 Stephen Haberman
4 -#
5 -
6 -test_description='git rebase preserve merges
7 -
8 -This test runs git rebase with -p and tries to squash a commit from after
9 -a merge to before the merge.
10 -'
11 -. ./test-lib.sh
12 -
13 -if ! test_have_prereq REBASE_P; then
14 - skip_all='skipping git rebase -p tests, as asked for'
15 - test_done
16 -fi
17 -
18 -. "$TEST_DIRECTORY"/lib-rebase.sh
19 -
20 -set_fake_editor
21 -
22 -# set up two branches like this:
23 -#
24 -# A1 - B1 - D1 - E1 - F1
25 -# \ /
26 -# -- C1 --
27 -
28 -test_expect_success 'setup' '
29 - test_commit A1 &&
30 - test_commit B1 &&
31 - test_commit C1 &&
32 - git reset --hard B1 &&
33 - test_commit D1 &&
34 - test_merge E1 C1 &&
35 - test_commit F1
36 -'
37 -
38 -# Should result in:
39 -#
40 -# A1 - B1 - D2 - E2
41 -# \ /
42 -# -- C1 --
43 -#
44 -test_expect_success 'squash F1 into D1' '
45 - FAKE_LINES="1 squash 4 2 3" git rebase -i -p B1 &&
46 - test "$(git rev-parse HEAD^2)" = "$(git rev-parse C1)" &&
47 - test "$(git rev-parse HEAD~2)" = "$(git rev-parse B1)" &&
48 - git tag E2
49 -'
50 -
51 -# Start with:
52 -#
53 -# A1 - B1 - D2 - E2
54 -# \
55 -# G1 ---- L1 ---- M1
56 -# \ /
57 -# H1 -- J1 -- K1
58 -# \ /
59 -# -- I1 --
60 -#
61 -# And rebase G1..M1 onto E2
62 -
63 -test_expect_success 'rebase two levels of merge' '
64 - git checkout A1 &&
65 - test_commit G1 &&
66 - test_commit H1 &&
67 - test_commit I1 &&
68 - git checkout -b branch3 H1 &&
69 - test_commit J1 &&
70 - test_merge K1 I1 &&
71 - git checkout -b branch2 G1 &&
72 - test_commit L1 &&
73 - test_merge M1 K1 &&
74 - GIT_EDITOR=: git rebase -i -p E2 &&
75 - test "$(git rev-parse HEAD~3)" = "$(git rev-parse E2)" &&
76 - test "$(git rev-parse HEAD~2)" = "$(git rev-parse HEAD^2^2~2)" &&
77 - test "$(git rev-parse HEAD^2^1^1)" = "$(git rev-parse HEAD^2^2^1)"
78 -'
79 -
80 -test_done
t/t3412-rebase-root.sh
-37
@@ -89,17 +89,6 @@ test_expect_success 'pre-rebase got correct input (4)' '
89 test "z$(cat .git/PRE-REBASE-INPUT)" = z--root,work4
90 '
91
92 -test_expect_success REBASE_P 'rebase -i -p with linear history' '
93 - git checkout -b work5 other &&
94 - git rebase -i -p --root --onto main &&
95 - git log --pretty=tformat:"%s" > rebased5 &&
96 - test_cmp expect rebased5
97 -'
98 -
99 -test_expect_success REBASE_P 'pre-rebase got correct input (5)' '
100 - test "z$(cat .git/PRE-REBASE-INPUT)" = z--root,
101 -'
102 -
92 test_expect_success 'set up merge history' '
93 git checkout other^ &&
94 git checkout -b side &&
@@ -123,13 +112,6 @@ commit work6~4
112 1
113 EOF
114
126 -test_expect_success REBASE_P 'rebase -i -p with merge' '
127 - git checkout -b work6 other &&
128 - git rebase -i -p --root --onto main &&
129 - log_with_names work6 > rebased6 &&
130 - test_cmp expect-side rebased6
131 -'
132 -
115 test_expect_success 'set up second root and merge' '
116 git symbolic-ref HEAD refs/heads/third &&
117 rm .git/index &&
@@ -158,13 +140,6 @@ commit work7~5
140 1
141 EOF
142
161 -test_expect_success REBASE_P 'rebase -i -p with two roots' '
162 - git checkout -b work7 other &&
163 - git rebase -i -p --root --onto main &&
164 - log_with_names work7 > rebased7 &&
165 - test_cmp expect-third rebased7
166 -'
167 -
143 test_expect_success 'setup pre-rebase hook that fails' '
144 mkdir -p .git/hooks &&
145 cat >.git/hooks/pre-rebase <<EOF &&
@@ -264,21 +239,9 @@ commit conflict3~6
239 1
240 EOF
241
267 -test_expect_success REBASE_P 'rebase -i -p --root with conflict (first part)' '
268 - git checkout -b conflict3 other &&
269 - test_must_fail git rebase -i -p --root --onto main &&
270 - git ls-files -u | grep "B$"
271 -'
272 -
242 test_expect_success 'fix the conflict' '
243 echo 3 > B &&
244 git add B
245 '
246
278 -test_expect_success REBASE_P 'rebase -i -p --root with conflict (second part)' '
279 - git rebase --continue &&
280 - log_with_names conflict3 >out &&
281 - test_cmp expect-conflict-p out
282 -'
283 -
247 test_done
t/t3414-rebase-preserve-onto.sh deleted
-85
@@ -1,85 +0,0 @@
1 -#!/bin/sh
2 -#
3 -# Copyright (c) 2009 Greg Price
4 -#
5 -
6 -test_description='git rebase -p should respect --onto
7 -
8 -In a rebase with --onto, we should rewrite all the commits that
9 -aren'"'"'t on top of $ONTO, even if they are on top of $UPSTREAM.
10 -'
11 -. ./test-lib.sh
12 -
13 -if ! test_have_prereq REBASE_P; then
14 - skip_all='skipping git rebase -p tests, as asked for'
15 - test_done
16 -fi
17 -
18 -. "$TEST_DIRECTORY"/lib-rebase.sh
19 -
20 -# Set up branches like this:
21 -# A1---B1---E1---F1---G1
22 -# \ \ /
23 -# \ \--C1---D1--/
24 -# H1
25 -
26 -test_expect_success 'setup' '
27 - test_commit A1 &&
28 - test_commit B1 &&
29 - test_commit C1 &&
30 - test_commit D1 &&
31 - git reset --hard B1 &&
32 - test_commit E1 &&
33 - test_commit F1 &&
34 - test_merge G1 D1 &&
35 - git reset --hard A1 &&
36 - test_commit H1
37 -'
38 -
39 -# Now rebase merge G1 from both branches' base B1, both should move:
40 -# A1---B1---E1---F1---G1
41 -# \ \ /
42 -# \ \--C1---D1--/
43 -# \
44 -# H1---E2---F2---G2
45 -# \ /
46 -# \--C2---D2--/
47 -
48 -test_expect_success 'rebase from B1 onto H1' '
49 - git checkout G1 &&
50 - git rebase -p --onto H1 B1 &&
51 - test "$(git rev-parse HEAD^1^1^1)" = "$(git rev-parse H1)" &&
52 - test "$(git rev-parse HEAD^2^1^1)" = "$(git rev-parse H1)"
53 -'
54 -
55 -# On the other hand if rebase from E1 which is within one branch,
56 -# then the other branch stays:
57 -# A1---B1---E1---F1---G1
58 -# \ \ /
59 -# \ \--C1---D1--/
60 -# \ \
61 -# H1-----F3-----G3
62 -
63 -test_expect_success 'rebase from E1 onto H1' '
64 - git checkout G1 &&
65 - git rebase -p --onto H1 E1 &&
66 - test "$(git rev-parse HEAD^1^1)" = "$(git rev-parse H1)" &&
67 - test "$(git rev-parse HEAD^2)" = "$(git rev-parse D1)"
68 -'
69 -
70 -# And the same if we rebase from a commit in the second-parent branch.
71 -# A1---B1---E1---F1----G1
72 -# \ \ \ /
73 -# \ \--C1---D1-\-/
74 -# \ \
75 -# H1------D3------G4
76 -
77 -test_expect_success 'rebase from C1 onto H1' '
78 - git checkout G1 &&
79 - git rev-list --first-parent --pretty=oneline C1..G1 &&
80 - git rebase -p --onto H1 C1 &&
81 - test "$(git rev-parse HEAD^2^1)" = "$(git rev-parse H1)" &&
82 - test "$(git rev-parse HEAD^1)" = "$(git rev-parse F1)"
83 -'
84 -
85 -test_done
t/t3418-rebase-continue.sh
-15
@@ -109,20 +109,6 @@ test_expect_success 'rebase -i --continue handles merge strategy and options' '
109 test -f funny.was.run
110 '
111
112 -test_expect_success REBASE_P 'rebase passes merge strategy options correctly' '
113 - rm -fr .git/rebase-* &&
114 - git reset --hard commit-new-file-F3-on-topic-branch &&
115 - test_commit theirs-to-merge &&
116 - git reset --hard HEAD^ &&
117 - test_commit some-commit &&
118 - test_tick &&
119 - git merge --no-ff theirs-to-merge &&
120 - FAKE_LINES="1 edit 2 3" git rebase -i -f -p -m \
121 - -s recursive --strategy-option=theirs HEAD~2 &&
122 - test_commit force-change &&
123 - git rebase --continue
124 -'
125 -
112 test_expect_success 'rebase -r passes merge strategy options correctly' '
113 rm -fr .git/rebase-* &&
114 git reset --hard commit-new-file-F3-on-topic-branch &&
@@ -258,7 +244,6 @@ test_rerere_autoupdate
244 test_rerere_autoupdate -m
245 GIT_SEQUENCE_EDITOR=: && export GIT_SEQUENCE_EDITOR
246 test_rerere_autoupdate -i
261 -test_have_prereq !REBASE_P || test_rerere_autoupdate --preserve-merges
247 unset GIT_SEQUENCE_EDITOR
248
249 test_expect_success 'the todo command "break" works' '
t/t3421-rebase-topology-linear.sh
-19
@@ -29,7 +29,6 @@ test_run_rebase () {
29 test_run_rebase success --apply
30 test_run_rebase success -m
31 test_run_rebase success -i
32 -test_have_prereq !REBASE_P || test_run_rebase success -p
32
33 test_expect_success 'setup branches and remote tracking' '
34 git tag -l >tags &&
@@ -53,7 +52,6 @@ test_run_rebase () {
52 test_run_rebase success --apply
53 test_run_rebase success -m
54 test_run_rebase success -i
56 -test_have_prereq !REBASE_P || test_run_rebase success -p
55
56 test_run_rebase () {
57 result=$1
@@ -70,7 +68,6 @@ test_run_rebase success --apply
68 test_run_rebase success --fork-point
69 test_run_rebase success -m
70 test_run_rebase success -i
73 -test_have_prereq !REBASE_P || test_run_rebase failure -p
71
72 test_run_rebase () {
73 result=$1
@@ -87,7 +84,6 @@ test_run_rebase success --apply
84 test_run_rebase success --fork-point
85 test_run_rebase success -m
86 test_run_rebase success -i
90 -test_have_prereq !REBASE_P || test_run_rebase success -p
87
88 test_run_rebase () {
89 result=$1
@@ -102,7 +98,6 @@ test_run_rebase success --apply
98 test_run_rebase success --fork-point
99 test_run_rebase success -m
100 test_run_rebase success -i
105 -test_have_prereq !REBASE_P || test_run_rebase success -p
101
102 # f
103 # /
@@ -142,7 +137,6 @@ test_run_rebase () {
137 test_run_rebase success --apply
138 test_run_rebase success -m
139 test_run_rebase success -i
145 -test_have_prereq !REBASE_P || test_run_rebase success -p
140
141 test_run_rebase () {
142 result=$1
@@ -157,7 +151,6 @@ test_run_rebase () {
151 test_run_rebase success --apply
152 test_run_rebase success -m
153 test_run_rebase success -i
160 -test_have_prereq !REBASE_P || test_run_rebase success -p
154
155 test_run_rebase () {
156 result=$1
@@ -172,7 +165,6 @@ test_run_rebase () {
165 test_run_rebase success --apply
166 test_run_rebase success -m
167 test_run_rebase success -i
175 -test_have_prereq !REBASE_P || test_run_rebase success -p
168
169 test_run_rebase () {
170 result=$1
@@ -187,7 +179,6 @@ test_run_rebase () {
179 test_run_rebase success --apply
180 test_run_rebase success -m
181 test_run_rebase success -i
190 -test_have_prereq !REBASE_P || test_run_rebase success -p
182
183 # a---b---c---j!
184 # \
@@ -215,7 +206,6 @@ test_run_rebase () {
206 test_run_rebase failure --apply
207 test_run_rebase success -m
208 test_run_rebase success -i
218 -test_have_prereq !REBASE_P || test_run_rebase failure -p
209
210 test_run_rebase () {
211 result=$1
@@ -229,7 +219,6 @@ test_run_rebase () {
219 }
220 test_run_rebase success -m
221 test_run_rebase success -i
232 -test_have_prereq !REBASE_P || test_run_rebase success -p
222
223 test_run_rebase () {
224 result=$1
@@ -243,7 +232,6 @@ test_run_rebase () {
232 }
233 test_run_rebase success -m
234 test_run_rebase success -i
246 -test_have_prereq !REBASE_P || test_run_rebase success -p
235 test_run_rebase success --rebase-merges
236
237 # m
@@ -283,7 +271,6 @@ test_run_rebase () {
271 test_run_rebase success --apply
272 test_run_rebase success -m
273 test_run_rebase success -i
286 -test_have_prereq !REBASE_P || test_run_rebase success -p
274
275 test_run_rebase () {
276 result=$1
@@ -298,7 +285,6 @@ test_run_rebase () {
285 test_run_rebase success --apply
286 test_run_rebase success -m
287 test_run_rebase success -i
301 -test_have_prereq !REBASE_P || test_run_rebase failure -p
288
289 test_run_rebase () {
290 result=$1
@@ -313,7 +299,6 @@ test_run_rebase () {
299 test_run_rebase success --apply
300 test_run_rebase success -m
301 test_run_rebase success -i
316 -test_have_prereq !REBASE_P || test_run_rebase success -p
302
303 test_run_rebase () {
304 result=$1
@@ -329,7 +314,6 @@ test_run_rebase () {
314 test_run_rebase success --apply
315 test_run_rebase success -m
316 test_run_rebase success -i
332 -test_have_prereq !REBASE_P || test_run_rebase failure -p
317
318 test_run_rebase () {
319 result=$1
@@ -344,7 +328,6 @@ test_run_rebase () {
328 test_run_rebase success --apply
329 test_run_rebase success -m
330 test_run_rebase success -i
347 -test_have_prereq !REBASE_P || test_run_rebase failure -p
331
332 test_run_rebase () {
333 result=$1
@@ -358,7 +341,6 @@ test_run_rebase () {
341 test_run_rebase success ''
342 test_run_rebase success -m
343 test_run_rebase success -i
361 -test_have_prereq !REBASE_P || test_run_rebase failure -p
344
345 test_run_rebase () {
346 result=$1
@@ -373,6 +355,5 @@ test_run_rebase () {
355 test_run_rebase success ''
356 test_run_rebase success -m
357 test_run_rebase success -i
376 -test_have_prereq !REBASE_P || test_run_rebase success -p
358
359 test_done
t/t3422-rebase-incompatible-options.sh
-11
@@ -63,15 +63,4 @@ test_rebase_am_only () {
63 test_rebase_am_only --whitespace=fix
64 test_rebase_am_only -C4
65
66 -test_expect_success REBASE_P '--preserve-merges incompatible with --signoff' '
67 - git checkout B^0 &&
68 - test_must_fail git rebase --preserve-merges --signoff A
69 -'
70 -
71 -test_expect_success REBASE_P \
72 - '--preserve-merges incompatible with --rebase-merges' '
73 - git checkout B^0 &&
74 - test_must_fail git rebase --preserve-merges --rebase-merges A
75 -'
76 -
66 test_done
t/t3425-rebase-topology-merges.sh
-151
@@ -106,155 +106,4 @@ test_run_rebase success 'd n o e' --apply
106 test_run_rebase success 'd n o e' -m
107 test_run_rebase success 'd n o e' -i
108
109 -if ! test_have_prereq REBASE_P; then
110 - skip_all='skipping git rebase -p tests, as asked for'
111 - test_done
112 -fi
113 -
114 -test_expect_success "rebase -p is no-op in non-linear history" "
115 - reset_rebase &&
116 - git rebase -p d w &&
117 - test_cmp_rev w HEAD
118 -"
119 -
120 -test_expect_success "rebase -p is no-op when base inside second parent" "
121 - reset_rebase &&
122 - git rebase -p e w &&
123 - test_cmp_rev w HEAD
124 -"
125 -
126 -test_expect_failure "rebase -p --root on non-linear history is a no-op" "
127 - reset_rebase &&
128 - git rebase -p --root w &&
129 - test_cmp_rev w HEAD
130 -"
131 -
132 -test_expect_success "rebase -p re-creates merge from side branch" "
133 - reset_rebase &&
134 - git rebase -p z w &&
135 - test_cmp_rev z HEAD^ &&
136 - test_cmp_rev w^2 HEAD^2
137 -"
138 -
139 -test_expect_success "rebase -p re-creates internal merge" "
140 - reset_rebase &&
141 - git rebase -p c w &&
142 - test_cmp_rev c HEAD~4 &&
143 - test_cmp_rev HEAD^2^ HEAD~3 &&
144 - test_revision_subjects 'd n e o w' HEAD~3 HEAD~2 HEAD^2 HEAD^ HEAD
145 -"
146 -
147 -test_expect_success "rebase -p can re-create two branches on onto" "
148 - reset_rebase &&
149 - git rebase -p --onto c d w &&
150 - test_cmp_rev c HEAD~3 &&
151 - test_cmp_rev c HEAD^2^ &&
152 - test_revision_subjects 'n e o w' HEAD~2 HEAD^2 HEAD^ HEAD
153 -"
154 -
155 -# f
156 -# /
157 -# a---b---c---g---h
158 -# \
159 -# d---gp--i
160 -# \ \
161 -# e-------u
162 -#
163 -# gp = cherry-picked g
164 -# h = reverted g
165 -test_expect_success 'setup of non-linear-history for patch-equivalence tests' '
166 - git checkout e &&
167 - test_merge u i
168 -'
169 -
170 -test_expect_success "rebase -p re-creates history around dropped commit matching upstream" "
171 - reset_rebase &&
172 - git rebase -p h u &&
173 - test_cmp_rev h HEAD~3 &&
174 - test_cmp_rev HEAD^2^ HEAD~2 &&
175 - test_revision_subjects 'd i e u' HEAD~2 HEAD^2 HEAD^ HEAD
176 -"
177 -
178 -test_expect_success "rebase -p --onto in merged history drops patches in upstream" "
179 - reset_rebase &&
180 - git rebase -p --onto f h u &&
181 - test_cmp_rev f HEAD~3 &&
182 - test_cmp_rev HEAD^2^ HEAD~2 &&
183 - test_revision_subjects 'd i e u' HEAD~2 HEAD^2 HEAD^ HEAD
184 -"
185 -
186 -test_expect_success "rebase -p --onto in merged history does not drop patches in onto" "
187 - reset_rebase &&
188 - git rebase -p --onto h f u &&
189 - test_cmp_rev h HEAD~3 &&
190 - test_cmp_rev HEAD^2~2 HEAD~2 &&
191 - test_revision_subjects 'd gp i e u' HEAD~2 HEAD^2^ HEAD^2 HEAD^ HEAD
192 -"
193 -
194 -# a---b---c---g---h
195 -# \
196 -# d---gp--s
197 -# \ \ /
198 -# \ X
199 -# \ / \
200 -# e---t
201 -#
202 -# gp = cherry-picked g
203 -# h = reverted g
204 -test_expect_success 'setup of non-linear-history for dropping whole side' '
205 - git checkout gp &&
206 - test_merge s e &&
207 - git checkout e &&
208 - test_merge t gp
209 -'
210 -
211 -test_expect_failure "rebase -p drops merge commit when entire first-parent side is dropped" "
212 - reset_rebase &&
213 - git rebase -p h s &&
214 - test_cmp_rev h HEAD~2 &&
215 - test_linear_range 'd e' h..
216 -"
217 -
218 -test_expect_success "rebase -p drops merge commit when entire second-parent side is dropped" "
219 - reset_rebase &&
220 - git rebase -p h t &&
221 - test_cmp_rev h HEAD~2 &&
222 - test_linear_range 'd e' h..
223 -"
224 -
225 -# a---b---c
226 -# \
227 -# d---e
228 -# \ \
229 -# n---r
230 -# \
231 -# o
232 -#
233 -# r = tree-same with n
234 -test_expect_success 'setup of non-linear-history for empty commits' '
235 - git checkout n &&
236 - git merge --no-commit e &&
237 - git reset n . &&
238 - git commit -m r &&
239 - git reset --hard &&
240 - git clean -f &&
241 - git tag r
242 -'
243 -
244 -test_expect_success "rebase -p re-creates empty internal merge commit" "
245 - reset_rebase &&
246 - git rebase -p c r &&
247 - test_cmp_rev c HEAD~3 &&
248 - test_cmp_rev HEAD^2^ HEAD~2 &&
249 - test_revision_subjects 'd e n r' HEAD~2 HEAD^2 HEAD^ HEAD
250 -"
251 -
252 -test_expect_success "rebase -p re-creates empty merge commit" "
253 - reset_rebase &&
254 - git rebase -p o r &&
255 - test_cmp_rev e HEAD^2 &&
256 - test_cmp_rev o HEAD^ &&
257 - test_revision_subjects 'r' HEAD
258 -"
259 -
109 test_done
t/t3427-rebase-subtree.sh
+3 -23
@@ -36,11 +36,10 @@ commit_message() {
36 # where the root commit adds three files: topic_1.t, topic_2.t and topic_3.t.
37 #
38 # This commit history is then rebased onto `topic_3` with the
39 -# `-Xsubtree=files_subtree` option in three different ways:
39 +# `-Xsubtree=files_subtree` option in two different ways:
40 #
41 -# 1. using `--preserve-merges`
42 -# 2. using `--preserve-merges` and --keep-empty
43 -# 3. without specifying a rebase backend
41 +# 1. without specifying a rebase backend
42 +# 2. using the `--rebase-merges` backend
43
44 test_expect_success 'setup' '
45 test_commit README &&
@@ -69,25 +68,6 @@ test_expect_success 'setup' '
68 git commit -m "Empty commit" --allow-empty
69 '
70
72 -# FAILURE: Does not preserve topic_4.
73 -test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit' '
74 - reset_rebase &&
75 - git checkout -b rebase-preserve-merges to-rebase &&
76 - git rebase -Xsubtree=files_subtree --preserve-merges --onto files-main main &&
77 - verbose test "$(commit_message HEAD~)" = "topic_4" &&
78 - verbose test "$(commit_message HEAD)" = "files_subtree/topic_5"
79 -'
80 -
81 -# FAILURE: Does not preserve topic_4.
82 -test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit' '
83 - reset_rebase &&
84 - git checkout -b rebase-keep-empty to-rebase &&
85 - git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-main main &&
86 - verbose test "$(commit_message HEAD~2)" = "topic_4" &&
87 - verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
88 - verbose test "$(commit_message HEAD)" = "Empty commit"
89 -'
90 -
71 test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
72 reset_rebase &&
73 git checkout -b rebase-onto to-rebase &&
t/t5520-pull.sh
-18
@@ -546,15 +546,6 @@ test_expect_success 'pull.rebase=1 is treated as true and flattens keep-merge' '
546 test_cmp expect actual
547 '
548
549 -test_expect_success REBASE_P \
550 - 'pull.rebase=preserve rebases and merges keep-merge' '
551 - git reset --hard before-preserve-rebase &&
552 - test_config pull.rebase preserve &&
553 - git pull . copy &&
554 - test_cmp_rev HEAD^^ copy &&
555 - test_cmp_rev HEAD^2 keep-merge
556 -'
557 -
549 test_expect_success 'pull.rebase=interactive' '
550 write_script "$TRASH_DIRECTORY/fake-editor" <<-\EOF &&
551 echo I was here >fake.out &&
@@ -606,15 +597,6 @@ test_expect_success '--rebase=true rebases and flattens keep-merge' '
597 test_cmp expect actual
598 '
599
609 -test_expect_success REBASE_P \
610 - '--rebase=preserve rebases and merges keep-merge' '
611 - git reset --hard before-preserve-rebase &&
612 - test_config pull.rebase true &&
613 - git pull --rebase=preserve . copy &&
614 - test_cmp_rev HEAD^^ copy &&
615 - test_cmp_rev HEAD^2 keep-merge
616 -'
617 -
600 test_expect_success '--rebase=invalid fails' '
601 git reset --hard before-preserve-rebase &&
602 test_must_fail git pull --rebase=invalid . copy
t/t7505-prepare-commit-msg-hook.sh
-1
@@ -250,7 +250,6 @@ test_rebase () {
250 }
251
252 test_rebase success
253 -test_have_prereq !REBASE_P || test_rebase success -p
253
254 test_expect_success 'with hook (cherry-pick)' '
255 test_when_finished "git checkout -f main" &&
t/t7517-per-repo-email.sh
-13
@@ -75,19 +75,6 @@ test_expect_success 'noop interactive rebase does not care about ident' '
75 git rebase -i HEAD^
76 '
77
78 -test_expect_success REBASE_P \
79 - 'fast-forward rebase does not care about ident (preserve)' '
80 - git checkout -B tmp side-without-commit &&
81 - git rebase -p main
82 -'
83 -
84 -test_expect_success REBASE_P \
85 - 'non-fast-forward rebase refuses to write commits (preserve)' '
86 - test_when_finished "git rebase --abort || true" &&
87 - git checkout -B tmp side-with-commit &&
88 - test_must_fail git rebase -p main
89 -'
90 -
78 test_expect_success 'author.name overrides user.name' '
79 test_config user.name user &&
80 test_config user.email user@example.com &&
t/test-lib.sh
-4
@@ -1708,10 +1708,6 @@ test_lazy_prereq SHA1 '
1708 esac
1709 '
1710
1711 -test_lazy_prereq REBASE_P '
1712 - test -z "$GIT_TEST_SKIP_REBASE_P"
1713 -'
1714 -
1711 # Ensure that no test accidentally triggers a Git command
1712 # that runs the actual maintenance scheduler, affecting a user's
1713 # system permanently.