git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 03/11] tests: stop testing `git rebase --preserve-merges`

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 7, 2021, 21:05 UTC
Message-ID
<e4b683f0cd6300cdda78075a03665db369c9a0aa.1631048713.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.195.v3.git.1631048712.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 .github/workflows/main.yml                |   1 -
 t/t3404-rebase-interactive.sh             |  76 -----------
 t/t3408-rebase-multi-line.sh              |  10 --
 t/t3409-rebase-preserve-merges.sh         | 130 -------------------
 t/t3410-rebase-preserve-dropped-merges.sh |  90 -------------
 t/t3411-rebase-preserve-around-merges.sh  |  80 ------------
 t/t3412-rebase-root.sh                    |  37 ------
 t/t3414-rebase-preserve-onto.sh           |  85 ------------
 t/t3418-rebase-continue.sh                |  15 ---
 t/t3421-rebase-topology-linear.sh         |  19 ---
 t/t3422-rebase-incompatible-options.sh    |  11 --
 t/t3425-rebase-topology-merges.sh         | 151 ----------------------
 t/t3427-rebase-subtree.sh                 |  26 +---
 t/t5520-pull.sh                           |  18 ---
 t/t7505-prepare-commit-msg-hook.sh        |   1 -
 t/t7517-per-repo-email.sh                 |  13 --
 t/test-lib.sh                             |   4 -
 17 files changed, 3 insertions(+), 764 deletions(-)
 delete mode 100755 t/t3409-rebase-preserve-merges.sh
 delete mode 100755 t/t3410-rebase-preserve-dropped-merges.sh
 delete mode 100755 t/t3411-rebase-preserve-around-merges.sh
 delete mode 100755 t/t3414-rebase-preserve-onto.sh
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 47876a4f02e..6115755c4df 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -198,7 +198,6 @@ jobs:
       shell: bash
       env:
         NO_SVN_TESTS: 1
-        GIT_TEST_SKIP_REBASE_P: 1
       run: ci/run-test-slice.sh ${{matrix.nr}} 10
     - name: ci/print-test-failures.sh
       if: failure()
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 66bcbbf9528..827b0450b9f 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -351,82 +351,6 @@ test_expect_success 'retain authorship when squashing' '
 	git show HEAD | grep "^Author: Twerp Snog"
 '
 
-test_expect_success REBASE_P '-p handles "no changes" gracefully' '
-	HEAD=$(git rev-parse HEAD) &&
-	git rebase -i -p HEAD^ &&
-	git update-index --refresh &&
-	git diff-files --quiet &&
-	git diff-index --quiet --cached HEAD -- &&
-	test $HEAD = $(git rev-parse HEAD)
-'
-
-test_expect_failure REBASE_P 'exchange two commits with -p' '
-	git checkout H &&
-	(
-		set_fake_editor &&
-		FAKE_LINES="2 1" git rebase -i -p HEAD~2
-	) &&
-	test H = $(git cat-file commit HEAD^ | sed -ne \$p) &&
-	test G = $(git cat-file commit HEAD | sed -ne \$p)
-'
-
-test_expect_success REBASE_P 'preserve merges with -p' '
-	git checkout -b to-be-preserved primary^ &&
-	: > unrelated-file &&
-	git add unrelated-file &&
-	test_tick &&
-	git commit -m "unrelated" &&
-	git checkout -b another-branch primary &&
-	echo B > file1 &&
-	test_tick &&
-	git commit -m J file1 &&
-	test_tick &&
-	git merge to-be-preserved &&
-	echo C > file1 &&
-	test_tick &&
-	git commit -m K file1 &&
-	echo D > file1 &&
-	test_tick &&
-	git commit -m L1 file1 &&
-	git checkout HEAD^ &&
-	echo 1 > unrelated-file &&
-	test_tick &&
-	git commit -m L2 unrelated-file &&
-	test_tick &&
-	git merge another-branch &&
-	echo E > file1 &&
-	test_tick &&
-	git commit -m M file1 &&
-	git checkout -b to-be-rebased &&
-	test_tick &&
-	git rebase -i -p --onto branch1 primary &&
-	git update-index --refresh &&
-	git diff-files --quiet &&
-	git diff-index --quiet --cached HEAD -- &&
-	test_cmp_rev HEAD~6 branch1 &&
-	test_cmp_rev HEAD~4^2 to-be-preserved &&
-	test_cmp_rev HEAD^^2^ HEAD^^^ &&
-	test $(git show HEAD~5:file1) = B &&
-	test $(git show HEAD~3:file1) = C &&
-	test $(git show HEAD:file1) = E &&
-	test $(git show HEAD:unrelated-file) = 1
-'
-
-test_expect_success REBASE_P 'edit ancestor with -p' '
-	(
-		set_fake_editor &&
-		FAKE_LINES="1 2 edit 3 4" git rebase -i -p HEAD~3
-	) &&
-	echo 2 > unrelated-file &&
-	test_tick &&
-	git commit -m L2-modified --amend unrelated-file &&
-	git rebase --continue &&
-	git update-index --refresh &&
-	git diff-files --quiet &&
-	git diff-index --quiet --cached HEAD -- &&
-	test $(git show HEAD:unrelated-file) = 2
-'
-
 test_expect_success '--continue tries to commit' '
 	git reset --hard D &&
 	test_tick &&
diff --git a/t/t3408-rebase-multi-line.sh b/t/t3408-rebase-multi-line.sh
index ab0960e6d99..cde3562e3a6 100755
--- a/t/t3408-rebase-multi-line.sh
+++ b/t/t3408-rebase-multi-line.sh
@@ -55,14 +55,4 @@ test_expect_success rebase '
 	test_cmp expect actual
 
 '
-test_expect_success REBASE_P rebasep '
-
-	git checkout side-merge &&
-	git rebase -p side &&
-	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
-	git cat-file commit side-merge-original | sed -e "1,/^\$/d" >expect &&
-	test_cmp expect actual
-
-'
-
 test_done
diff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh
deleted file mode 100755
index ec8062a66ac..00000000000
--- a/t/t3409-rebase-preserve-merges.sh
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/bin/sh
-#
-# Copyright(C) 2008 Stephen Habermann & Andreas Ericsson
-#
-test_description='git rebase -p should preserve merges
-
-Run "git rebase -p" and check that merges are properly carried along
-'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
-export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
-
-. ./test-lib.sh
-
-if ! test_have_prereq REBASE_P; then
-	skip_all='skipping git rebase -p tests, as asked for'
-	test_done
-fi
-
-GIT_AUTHOR_EMAIL=bogus_email_address
-export GIT_AUTHOR_EMAIL
-
-# Clone 2 (conflicting merge):
-#
-# A1--A2--B3   <-- origin/main
-#  \       \
-#   B1------M  <-- topic
-#    \
-#     B2       <-- origin/topic
-#
-# Clone 3 (no-ff merge):
-#
-# A1--A2--B3   <-- origin/main
-#  \
-#   B1------M  <-- topic
-#    \     /
-#     \--A3    <-- topic2
-#      \
-#       B2     <-- origin/topic
-#
-# Clone 4 (same as Clone 3)
-
-test_expect_success 'setup for merge-preserving rebase' \
-	'echo First > A &&
-	git add A &&
-	git commit -m "Add A1" &&
-	git checkout -b topic &&
-	echo Second > B &&
-	git add B &&
-	git commit -m "Add B1" &&
-	git checkout -f main &&
-	echo Third >> A &&
-	git commit -a -m "Modify A2" &&
-	echo Fifth > B &&
-	git add B &&
-	git commit -m "Add different B" &&
-
-	git clone ./. clone2 &&
-	(
-		cd clone2 &&
-		git checkout -b topic origin/topic &&
-		test_must_fail git merge origin/main &&
-		echo Resolved >B &&
-		git add B &&
-		git commit -m "Merge origin/main into topic"
-	) &&
-
-	git clone ./. clone3 &&
-	(
-		cd clone3 &&
-		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 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 &&
-	echo Fourth >> B &&
-	git commit -a -m "Modify B2"
-'
-
-test_expect_success '--continue works after a conflict' '
-	(
-	cd clone2 &&
-	git fetch &&
-	test_must_fail git rebase -p origin/topic &&
-	test 2 = $(git ls-files B | wc -l) &&
-	echo Resolved again > B &&
-	test_must_fail git rebase --continue &&
-	grep "^@@@ " .git/rebase-merge/patch &&
-	git add B &&
-	git rebase --continue &&
-	test 1 = $(git rev-list --all --pretty=oneline | grep "Modify A" | wc -l) &&
-	test 1 = $(git rev-list --all --pretty=oneline | grep "Add different" | wc -l) &&
-	test 1 = $(git rev-list --all --pretty=oneline | grep "Merge origin" | wc -l)
-	)
-'
-
-test_expect_success 'rebase -p preserves no-ff merges' '
-	(
-	cd clone3 &&
-	git fetch &&
-	git rebase -p origin/topic &&
-	test 3 = $(git rev-list --all --pretty=oneline | grep "Modify A" | wc -l) &&
-	test 1 = $(git rev-list --all --pretty=oneline | grep "Merge branch" | wc -l)
-	)
-'
-
-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
diff --git a/t/t3410-rebase-preserve-dropped-merges.sh b/t/t3410-rebase-preserve-dropped-merges.sh
deleted file mode 100755
index 2e29866993c..00000000000
--- a/t/t3410-rebase-preserve-dropped-merges.sh
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2008 Stephen Haberman
-#
-
-test_description='git rebase preserve merges
-
-This test runs git rebase with preserve merges and ensures commits
-dropped by the --cherry-pick flag have their childrens parents
-rewritten.
-'
-. ./test-lib.sh
-
-if ! test_have_prereq REBASE_P; then
-	skip_all='skipping git rebase -p tests, as asked for'
-	test_done
-fi
-
-# set up two branches like this:
-#
-# A - B - C - D - E
-#   \
-#     F - G - H
-#       \
-#         I
-#
-# where B, D and G touch the same file.
-
-test_expect_success 'setup' '
-	test_commit A file1 &&
-	test_commit B file1 1 &&
-	test_commit C file2 &&
-	test_commit D file1 2 &&
-	test_commit E file3 &&
-	git checkout A &&
-	test_commit F file4 &&
-	test_commit G file1 3 &&
-	test_commit H file5 &&
-	git checkout F &&
-	test_commit I file6
-'
-
-# A - B - C - D - E
-#   \             \ \
-#     F - G - H -- L \        -->   L
-#       \            |               \
-#         I -- G2 -- J -- K           I -- K
-# G2 = same changes as G
-test_expect_success 'skip same-resolution merges with -p' '
-	git checkout H &&
-	test_must_fail git merge E &&
-	test_commit L file1 23 &&
-	git checkout I &&
-	test_commit G2 file1 3 &&
-	test_must_fail git merge E &&
-	test_commit J file1 23 &&
-	test_commit K file7 file7 &&
-	git rebase -i -p L &&
-	test $(git rev-parse HEAD^^) = $(git rev-parse L) &&
-	test "23" = "$(cat file1)" &&
-	test "I" = "$(cat file6)" &&
-	test "file7" = "$(cat file7)"
-'
-
-# A - B - C - D - E
-#   \             \ \
-#     F - G - H -- L2 \        -->   L2
-#       \             |                \
-#         I -- G3 --- J2 -- K2           I -- G3 -- K2
-# G2 = different changes as G
-test_expect_success 'keep different-resolution merges with -p' '
-	git checkout H &&
-	test_must_fail git merge E &&
-	test_commit L2 file1 23 &&
-	git checkout I &&
-	test_commit G3 file1 4 &&
-	test_must_fail git merge E &&
-	test_commit J2 file1 24 &&
-	test_commit K2 file7 file7 &&
-	test_must_fail git rebase -i -p L2 &&
-	echo 234 > file1 &&
-	git add file1 &&
-	git rebase --continue &&
-	test $(git rev-parse HEAD^^^) = $(git rev-parse L2) &&
-	test "234" = "$(cat file1)" &&
-	test "I" = "$(cat file6)" &&
-	test "file7" = "$(cat file7)"
-'
-
-test_done
diff --git a/t/t3411-rebase-preserve-around-merges.sh b/t/t3411-rebase-preserve-around-merges.sh
deleted file mode 100755
index fb45e7bf7bd..00000000000
--- a/t/t3411-rebase-preserve-around-merges.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2008 Stephen Haberman
-#
-
-test_description='git rebase preserve merges
-
-This test runs git rebase with -p and tries to squash a commit from after
-a merge to before the merge.
-'
-. ./test-lib.sh
-
-if ! test_have_prereq REBASE_P; then
-	skip_all='skipping git rebase -p tests, as asked for'
-	test_done
-fi
-
-. "$TEST_DIRECTORY"/lib-rebase.sh
-
-set_fake_editor
-
-# set up two branches like this:
-#
-# A1 - B1 - D1 - E1 - F1
-#       \        /
-#        -- C1 --
-
-test_expect_success 'setup' '
-	test_commit A1 &&
-	test_commit B1 &&
-	test_commit C1 &&
-	git reset --hard B1 &&
-	test_commit D1 &&
-	test_merge E1 C1 &&
-	test_commit F1
-'
-
-# Should result in:
-#
-# A1 - B1 - D2 - E2
-#       \        /
-#        -- C1 --
-#
-test_expect_success 'squash F1 into D1' '
-	FAKE_LINES="1 squash 4 2 3" git rebase -i -p B1 &&
-	test "$(git rev-parse HEAD^2)" = "$(git rev-parse C1)" &&
-	test "$(git rev-parse HEAD~2)" = "$(git rev-parse B1)" &&
-	git tag E2
-'
-
-# Start with:
-#
-# A1 - B1 - D2 - E2
-#  \
-#   G1 ---- L1 ---- M1
-#    \             /
-#     H1 -- J1 -- K1
-#      \         /
-#        -- I1 --
-#
-# And rebase G1..M1 onto E2
-
-test_expect_success 'rebase two levels of merge' '
-	git checkout A1 &&
-	test_commit G1 &&
-	test_commit H1 &&
-	test_commit I1 &&
-	git checkout -b branch3 H1 &&
-	test_commit J1 &&
-	test_merge K1 I1 &&
-	git checkout -b branch2 G1 &&
-	test_commit L1 &&
-	test_merge M1 K1 &&
-	GIT_EDITOR=: git rebase -i -p E2 &&
-	test "$(git rev-parse HEAD~3)" = "$(git rev-parse E2)" &&
-	test "$(git rev-parse HEAD~2)" = "$(git rev-parse HEAD^2^2~2)" &&
-	test "$(git rev-parse HEAD^2^1^1)" = "$(git rev-parse HEAD^2^2^1)"
-'
-
-test_done
diff --git a/t/t3412-rebase-root.sh b/t/t3412-rebase-root.sh
index fda62c65bd5..19c6f4acbf6 100755
--- a/t/t3412-rebase-root.sh
+++ b/t/t3412-rebase-root.sh
@@ -89,17 +89,6 @@ test_expect_success 'pre-rebase got correct input (4)' '
 	test "z$(cat .git/PRE-REBASE-INPUT)" = z--root,work4
 '
 
-test_expect_success REBASE_P 'rebase -i -p with linear history' '
-	git checkout -b work5 other &&
-	git rebase -i -p --root --onto main &&
-	git log --pretty=tformat:"%s" > rebased5 &&
-	test_cmp expect rebased5
-'
-
-test_expect_success REBASE_P 'pre-rebase got correct input (5)' '
-	test "z$(cat .git/PRE-REBASE-INPUT)" = z--root,
-'
-
 test_expect_success 'set up merge history' '
 	git checkout other^ &&
 	git checkout -b side &&
@@ -123,13 +112,6 @@ commit work6~4
 1
 EOF
 
-test_expect_success REBASE_P 'rebase -i -p with merge' '
-	git checkout -b work6 other &&
-	git rebase -i -p --root --onto main &&
-	log_with_names work6 > rebased6 &&
-	test_cmp expect-side rebased6
-'
-
 test_expect_success 'set up second root and merge' '
 	git symbolic-ref HEAD refs/heads/third &&
 	rm .git/index &&
@@ -158,13 +140,6 @@ commit work7~5
 1
 EOF
 
-test_expect_success REBASE_P 'rebase -i -p with two roots' '
-	git checkout -b work7 other &&
-	git rebase -i -p --root --onto main &&
-	log_with_names work7 > rebased7 &&
-	test_cmp expect-third rebased7
-'
-
 test_expect_success 'setup pre-rebase hook that fails' '
 	mkdir -p .git/hooks &&
 	cat >.git/hooks/pre-rebase <<EOF &&
@@ -264,21 +239,9 @@ commit conflict3~6
 1
 EOF
 
-test_expect_success REBASE_P 'rebase -i -p --root with conflict (first part)' '
-	git checkout -b conflict3 other &&
-	test_must_fail git rebase -i -p --root --onto main &&
-	git ls-files -u | grep "B$"
-'
-
 test_expect_success 'fix the conflict' '
 	echo 3 > B &&
 	git add B
 '
 
-test_expect_success REBASE_P 'rebase -i -p --root with conflict (second part)' '
-	git rebase --continue &&
-	log_with_names conflict3 >out &&
-	test_cmp expect-conflict-p out
-'
-
 test_done
diff --git a/t/t3414-rebase-preserve-onto.sh b/t/t3414-rebase-preserve-onto.sh
deleted file mode 100755
index 72e04b5386a..00000000000
--- a/t/t3414-rebase-preserve-onto.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2009 Greg Price
-#
-
-test_description='git rebase -p should respect --onto
-
-In a rebase with --onto, we should rewrite all the commits that
-aren'"'"'t on top of $ONTO, even if they are on top of $UPSTREAM.
-'
-. ./test-lib.sh
-
-if ! test_have_prereq REBASE_P; then
-	skip_all='skipping git rebase -p tests, as asked for'
-	test_done
-fi
-
-. "$TEST_DIRECTORY"/lib-rebase.sh
-
-# Set up branches like this:
-# A1---B1---E1---F1---G1
-#  \    \             /
-#   \    \--C1---D1--/
-#    H1
-
-test_expect_success 'setup' '
-	test_commit A1 &&
-	test_commit B1 &&
-	test_commit C1 &&
-	test_commit D1 &&
-	git reset --hard B1 &&
-	test_commit E1 &&
-	test_commit F1 &&
-	test_merge G1 D1 &&
-	git reset --hard A1 &&
-	test_commit H1
-'
-
-# Now rebase merge G1 from both branches' base B1, both should move:
-# A1---B1---E1---F1---G1
-#  \    \             /
-#   \    \--C1---D1--/
-#    \
-#     H1---E2---F2---G2
-#      \             /
-#       \--C2---D2--/
-
-test_expect_success 'rebase from B1 onto H1' '
-	git checkout G1 &&
-	git rebase -p --onto H1 B1 &&
-	test "$(git rev-parse HEAD^1^1^1)" = "$(git rev-parse H1)" &&
-	test "$(git rev-parse HEAD^2^1^1)" = "$(git rev-parse H1)"
-'
-
-# On the other hand if rebase from E1 which is within one branch,
-# then the other branch stays:
-# A1---B1---E1---F1---G1
-#  \    \             /
-#   \    \--C1---D1--/
-#    \             \
-#     H1-----F3-----G3
-
-test_expect_success 'rebase from E1 onto H1' '
-	git checkout G1 &&
-	git rebase -p --onto H1 E1 &&
-	test "$(git rev-parse HEAD^1^1)" = "$(git rev-parse H1)" &&
-	test "$(git rev-parse HEAD^2)" = "$(git rev-parse D1)"
-'
-
-# And the same if we rebase from a commit in the second-parent branch.
-# A1---B1---E1---F1----G1
-#  \    \          \   /
-#   \    \--C1---D1-\-/
-#    \               \
-#     H1------D3------G4
-
-test_expect_success 'rebase from C1 onto H1' '
-	git checkout G1 &&
-	git rev-list --first-parent --pretty=oneline C1..G1 &&
-	git rebase -p --onto H1 C1 &&
-	test "$(git rev-parse HEAD^2^1)" = "$(git rev-parse H1)" &&
-	test "$(git rev-parse HEAD^1)" = "$(git rev-parse F1)"
-'
-
-test_done
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index f4c2ee02bc9..b62c16026fc 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -109,20 +109,6 @@ test_expect_success 'rebase -i --continue handles merge strategy and options' '
 	test -f funny.was.run
 '
 
-test_expect_success REBASE_P 'rebase passes merge strategy options correctly' '
-	rm -fr .git/rebase-* &&
-	git reset --hard commit-new-file-F3-on-topic-branch &&
-	test_commit theirs-to-merge &&
-	git reset --hard HEAD^ &&
-	test_commit some-commit &&
-	test_tick &&
-	git merge --no-ff theirs-to-merge &&
-	FAKE_LINES="1 edit 2 3" git rebase -i -f -p -m \
-		-s recursive --strategy-option=theirs HEAD~2 &&
-	test_commit force-change &&
-	git rebase --continue
-'
-
 test_expect_success 'rebase -r passes merge strategy options correctly' '
 	rm -fr .git/rebase-* &&
 	git reset --hard commit-new-file-F3-on-topic-branch &&
@@ -258,7 +244,6 @@ test_rerere_autoupdate
 test_rerere_autoupdate -m
 GIT_SEQUENCE_EDITOR=: && export GIT_SEQUENCE_EDITOR
 test_rerere_autoupdate -i
-test_have_prereq !REBASE_P || test_rerere_autoupdate --preserve-merges
 unset GIT_SEQUENCE_EDITOR
 
 test_expect_success 'the todo command "break" works' '
diff --git a/t/t3421-rebase-topology-linear.sh b/t/t3421-rebase-topology-linear.sh
index 4a9204b4b64..62d86d557da 100755
--- a/t/t3421-rebase-topology-linear.sh
+++ b/t/t3421-rebase-topology-linear.sh
@@ -29,7 +29,6 @@ test_run_rebase () {
 test_run_rebase success --apply
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 
 test_expect_success 'setup branches and remote tracking' '
 	git tag -l >tags &&
@@ -53,7 +52,6 @@ test_run_rebase () {
 test_run_rebase success --apply
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 
 test_run_rebase () {
 	result=$1
@@ -70,7 +68,6 @@ test_run_rebase success --apply
 test_run_rebase success --fork-point
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase failure -p
 
 test_run_rebase () {
 	result=$1
@@ -87,7 +84,6 @@ test_run_rebase success --apply
 test_run_rebase success --fork-point
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 
 test_run_rebase () {
 	result=$1
@@ -102,7 +98,6 @@ test_run_rebase success --apply
 test_run_rebase success --fork-point
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 
 #       f
 #      /
@@ -142,7 +137,6 @@ test_run_rebase () {
 test_run_rebase success --apply
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 
 test_run_rebase () {
 	result=$1
@@ -157,7 +151,6 @@ test_run_rebase () {
 test_run_rebase success --apply
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 
 test_run_rebase () {
 	result=$1
@@ -172,7 +165,6 @@ test_run_rebase () {
 test_run_rebase success --apply
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 
 test_run_rebase () {
 	result=$1
@@ -187,7 +179,6 @@ test_run_rebase () {
 test_run_rebase success --apply
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 
 # a---b---c---j!
 #      \
@@ -215,7 +206,6 @@ test_run_rebase () {
 test_run_rebase failure --apply
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase failure -p
 
 test_run_rebase () {
 	result=$1
@@ -229,7 +219,6 @@ test_run_rebase () {
 }
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 
 test_run_rebase () {
 	result=$1
@@ -243,7 +232,6 @@ test_run_rebase () {
 }
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 test_run_rebase success --rebase-merges
 
 #       m
@@ -283,7 +271,6 @@ test_run_rebase () {
 test_run_rebase success --apply
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 
 test_run_rebase () {
 	result=$1
@@ -298,7 +285,6 @@ test_run_rebase () {
 test_run_rebase success --apply
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase failure -p
 
 test_run_rebase () {
 	result=$1
@@ -313,7 +299,6 @@ test_run_rebase () {
 test_run_rebase success --apply
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 
 test_run_rebase () {
 	result=$1
@@ -329,7 +314,6 @@ test_run_rebase () {
 test_run_rebase success --apply
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase failure -p
 
 test_run_rebase () {
 	result=$1
@@ -344,7 +328,6 @@ test_run_rebase () {
 test_run_rebase success --apply
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase failure -p
 
 test_run_rebase () {
 	result=$1
@@ -358,7 +341,6 @@ test_run_rebase () {
 test_run_rebase success ''
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase failure -p
 
 test_run_rebase () {
 	result=$1
@@ -373,6 +355,5 @@ test_run_rebase () {
 test_run_rebase success ''
 test_run_rebase success -m
 test_run_rebase success -i
-test_have_prereq !REBASE_P || test_run_rebase success -p
 
 test_done
diff --git a/t/t3422-rebase-incompatible-options.sh b/t/t3422-rebase-incompatible-options.sh
index c8234062c6c..eb0a3d9d487 100755
--- a/t/t3422-rebase-incompatible-options.sh
+++ b/t/t3422-rebase-incompatible-options.sh
@@ -63,15 +63,4 @@ test_rebase_am_only () {
 test_rebase_am_only --whitespace=fix
 test_rebase_am_only -C4
 
-test_expect_success REBASE_P '--preserve-merges incompatible with --signoff' '
-	git checkout B^0 &&
-	test_must_fail git rebase --preserve-merges --signoff A
-'
-
-test_expect_success REBASE_P \
-	'--preserve-merges incompatible with --rebase-merges' '
-	git checkout B^0 &&
-	test_must_fail git rebase --preserve-merges --rebase-merges A
-'
-
 test_done
diff --git a/t/t3425-rebase-topology-merges.sh b/t/t3425-rebase-topology-merges.sh
index e42faa44e74..63acc1ea4da 100755
--- a/t/t3425-rebase-topology-merges.sh
+++ b/t/t3425-rebase-topology-merges.sh
@@ -106,155 +106,4 @@ test_run_rebase success 'd n o e' --apply
 test_run_rebase success 'd n o e' -m
 test_run_rebase success 'd n o e' -i
 
-if ! test_have_prereq REBASE_P; then
-	skip_all='skipping git rebase -p tests, as asked for'
-	test_done
-fi
-
-test_expect_success "rebase -p is no-op in non-linear history" "
-	reset_rebase &&
-	git rebase -p d w &&
-	test_cmp_rev w HEAD
-"
-
-test_expect_success "rebase -p is no-op when base inside second parent" "
-	reset_rebase &&
-	git rebase -p e w &&
-	test_cmp_rev w HEAD
-"
-
-test_expect_failure "rebase -p --root on non-linear history is a no-op" "
-	reset_rebase &&
-	git rebase -p --root w &&
-	test_cmp_rev w HEAD
-"
-
-test_expect_success "rebase -p re-creates merge from side branch" "
-	reset_rebase &&
-	git rebase -p z w &&
-	test_cmp_rev z HEAD^ &&
-	test_cmp_rev w^2 HEAD^2
-"
-
-test_expect_success "rebase -p re-creates internal merge" "
-	reset_rebase &&
-	git rebase -p c w &&
-	test_cmp_rev c HEAD~4 &&
-	test_cmp_rev HEAD^2^ HEAD~3 &&
-	test_revision_subjects 'd n e o w' HEAD~3 HEAD~2 HEAD^2 HEAD^ HEAD
-"
-
-test_expect_success "rebase -p can re-create two branches on onto" "
-	reset_rebase &&
-	git rebase -p --onto c d w &&
-	test_cmp_rev c HEAD~3 &&
-	test_cmp_rev c HEAD^2^ &&
-	test_revision_subjects 'n e o w' HEAD~2 HEAD^2 HEAD^ HEAD
-"
-
-#       f
-#      /
-# a---b---c---g---h
-#      \
-#       d---gp--i
-#        \       \
-#         e-------u
-#
-# gp = cherry-picked g
-# h = reverted g
-test_expect_success 'setup of non-linear-history for patch-equivalence tests' '
-	git checkout e &&
-	test_merge u i
-'
-
-test_expect_success "rebase -p re-creates history around dropped commit matching upstream" "
-	reset_rebase &&
-	git rebase -p h u &&
-	test_cmp_rev h HEAD~3 &&
-	test_cmp_rev HEAD^2^ HEAD~2 &&
-	test_revision_subjects 'd i e u' HEAD~2 HEAD^2 HEAD^ HEAD
-"
-
-test_expect_success "rebase -p --onto in merged history drops patches in upstream" "
-	reset_rebase &&
-	git rebase -p --onto f h u &&
-	test_cmp_rev f HEAD~3 &&
-	test_cmp_rev HEAD^2^ HEAD~2 &&
-	test_revision_subjects 'd i e u' HEAD~2 HEAD^2 HEAD^ HEAD
-"
-
-test_expect_success "rebase -p --onto in merged history does not drop patches in onto" "
-	reset_rebase &&
-	git rebase -p --onto h f u &&
-	test_cmp_rev h HEAD~3 &&
-	test_cmp_rev HEAD^2~2 HEAD~2 &&
-	test_revision_subjects 'd gp i e u' HEAD~2 HEAD^2^ HEAD^2 HEAD^ HEAD
-"
-
-# a---b---c---g---h
-#      \
-#       d---gp--s
-#        \   \ /
-#         \   X
-#          \ / \
-#           e---t
-#
-# gp = cherry-picked g
-# h = reverted g
-test_expect_success 'setup of non-linear-history for dropping whole side' '
-	git checkout gp &&
-	test_merge s e &&
-	git checkout e &&
-	test_merge t gp
-'
-
-test_expect_failure "rebase -p drops merge commit when entire first-parent side is dropped" "
-	reset_rebase &&
-	git rebase -p h s &&
-	test_cmp_rev h HEAD~2 &&
-	test_linear_range 'd e' h..
-"
-
-test_expect_success "rebase -p drops merge commit when entire second-parent side is dropped" "
-	reset_rebase &&
-	git rebase -p h t &&
-	test_cmp_rev h HEAD~2 &&
-	test_linear_range 'd e' h..
-"
-
-# a---b---c
-#      \
-#       d---e
-#        \   \
-#         n---r
-#          \
-#           o
-#
-# r = tree-same with n
-test_expect_success 'setup of non-linear-history for empty commits' '
-	git checkout n &&
-	git merge --no-commit e &&
-	git reset n . &&
-	git commit -m r &&
-	git reset --hard &&
-	git clean -f &&
-	git tag r
-'
-
-test_expect_success "rebase -p re-creates empty internal merge commit" "
-	reset_rebase &&
-	git rebase -p c r &&
-	test_cmp_rev c HEAD~3 &&
-	test_cmp_rev HEAD^2^ HEAD~2 &&
-	test_revision_subjects 'd e n r' HEAD~2 HEAD^2 HEAD^ HEAD
-"
-
-test_expect_success "rebase -p re-creates empty merge commit" "
-	reset_rebase &&
-	git rebase -p o r &&
-	test_cmp_rev e HEAD^2 &&
-	test_cmp_rev o HEAD^ &&
-	test_revision_subjects 'r' HEAD
-"
-
 test_done
diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index e78c7e37969..48b76f82325 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -36,11 +36,10 @@ commit_message() {
 # where the root commit adds three files: topic_1.t, topic_2.t and topic_3.t.
 #
 # This commit history is then rebased onto `topic_3` with the
-# `-Xsubtree=files_subtree` option in three different ways:
+# `-Xsubtree=files_subtree` option in two different ways:
 #
-# 1. using `--preserve-merges`
-# 2. using `--preserve-merges` and --keep-empty
-# 3. without specifying a rebase backend
+# 1. without specifying a rebase backend
+# 2. using the `--rebase-merges` backend
 
 test_expect_success 'setup' '
 	test_commit README &&
@@ -69,25 +68,6 @@ test_expect_success 'setup' '
 	git commit -m "Empty commit" --allow-empty
 '
 
-# FAILURE: Does not preserve topic_4.
-test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit' '
-	reset_rebase &&
-	git checkout -b rebase-preserve-merges to-rebase &&
-	git rebase -Xsubtree=files_subtree --preserve-merges --onto files-main main &&
-	verbose test "$(commit_message HEAD~)" = "topic_4" &&
-	verbose test "$(commit_message HEAD)" = "files_subtree/topic_5"
-'
-
-# FAILURE: Does not preserve topic_4.
-test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit' '
-	reset_rebase &&
-	git checkout -b rebase-keep-empty to-rebase &&
-	git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-main main &&
-	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
-	verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
-	verbose test "$(commit_message HEAD)" = "Empty commit"
-'
-
 test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-onto to-rebase &&
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index bb9b6b900eb..a2924036ad4 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -546,15 +546,6 @@ test_expect_success 'pull.rebase=1 is treated as true and flattens keep-merge' '
 	test_cmp expect actual
 '
 
-test_expect_success REBASE_P \
-	'pull.rebase=preserve rebases and merges keep-merge' '
-	git reset --hard before-preserve-rebase &&
-	test_config pull.rebase preserve &&
-	git pull . copy &&
-	test_cmp_rev HEAD^^ copy &&
-	test_cmp_rev HEAD^2 keep-merge
-'
-
 test_expect_success 'pull.rebase=interactive' '
 	write_script "$TRASH_DIRECTORY/fake-editor" <<-\EOF &&
 	echo I was here >fake.out &&
@@ -606,15 +597,6 @@ test_expect_success '--rebase=true rebases and flattens keep-merge' '
 	test_cmp expect actual
 '
 
-test_expect_success REBASE_P \
-	'--rebase=preserve rebases and merges keep-merge' '
-	git reset --hard before-preserve-rebase &&
-	test_config pull.rebase true &&
-	git pull --rebase=preserve . copy &&
-	test_cmp_rev HEAD^^ copy &&
-	test_cmp_rev HEAD^2 keep-merge
-'
-
 test_expect_success '--rebase=invalid fails' '
 	git reset --hard before-preserve-rebase &&
 	test_must_fail git pull --rebase=invalid . copy
diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh
index 7a8194ce720..2a07c708679 100755
--- a/t/t7505-prepare-commit-msg-hook.sh
+++ b/t/t7505-prepare-commit-msg-hook.sh
@@ -250,7 +250,6 @@ test_rebase () {
 }
 
 test_rebase success
-test_have_prereq !REBASE_P || test_rebase success -p
 
 test_expect_success 'with hook (cherry-pick)' '
 	test_when_finished "git checkout -f main" &&
diff --git a/t/t7517-per-repo-email.sh b/t/t7517-per-repo-email.sh
index 405420ae4d8..163ae804685 100755
--- a/t/t7517-per-repo-email.sh
+++ b/t/t7517-per-repo-email.sh
@@ -75,19 +75,6 @@ test_expect_success 'noop interactive rebase does not care about ident' '
 	git rebase -i HEAD^
 '
 
-test_expect_success REBASE_P \
-	'fast-forward rebase does not care about ident (preserve)' '
-	git checkout -B tmp side-without-commit &&
-	git rebase -p main
-'
-
-test_expect_success REBASE_P \
-	'non-fast-forward rebase refuses to write commits (preserve)' '
-	test_when_finished "git rebase --abort || true" &&
-	git checkout -B tmp side-with-commit &&
-	test_must_fail git rebase -p main
-'
-
 test_expect_success 'author.name overrides user.name' '
 	test_config user.name user &&
 	test_config user.email user@example.com &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index abcfbed6d61..11a9c8a6516 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1708,10 +1708,6 @@ test_lazy_prereq SHA1 '
 	esac
 '
 
-test_lazy_prereq REBASE_P '
-	test -z "$GIT_TEST_SKIP_REBASE_P"
-'
-
 # Ensure that no test accidentally triggers a Git command
 # that runs the actual maintenance scheduler, affecting a user's
 # system permanently.
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 65 of 78 in “Drop support for git rebase --preserve-merges”
  1. 0/8 Drop support for git rebase --preserve-mergesJohannes Schindelin via GitGitGadget, Nov 23, 2019
  2. 1/8 t5520: do not use `pull.rebase=preserve`Johannes Schindelin via GitGitGadget, Nov 23, 2019
  3. 2/8 remote: warn about unhandled branch.<name>.rebase valuesJohannes Schindelin via GitGitGadget, Nov 23, 2019
  4. 4/8 pull: remove support for `--rebase=preserve`Johannes Schindelin via GitGitGadget, Nov 23, 2019
  5. 6/8 git-svn: drop support for `--preserve-merges`Johannes Schindelin via GitGitGadget, Nov 23, 2019
  6. Eric WongNov 23, 2019
  7. Johannes SchindelinNov 24, 2019
  8. Eric WongNov 25, 2019
  9. 3/8 tests: stop testing `git rebase --preserve-merges`Johannes Schindelin via GitGitGadget, Nov 23, 2019
  10. 8/8 remote: no longer claim that branch.*.rebase=preserve is a thingJohannes Schindelin via GitGitGadget, Nov 23, 2019
  11. 7/8 rebase: drop the internal `rebase--interactive` commandJohannes Schindelin via GitGitGadget, Nov 23, 2019
  12. 5/8 rebase: drop support for `--preserve-merges`Johannes Schindelin via GitGitGadget, Nov 23, 2019
  13. 0/7 Drop support for git rebase --preserve-mergesJohannes Schindelin via GitGitGadget, Sep 1, 2021
  14. 1/7 t5520: do not use `pull.rebase=preserve`Johannes Schindelin via GitGitGadget, Sep 1, 2021
  15. 2/7 remote: warn about unhandled branch.<name>.rebase valuesJohannes Schindelin via GitGitGadget, Sep 1, 2021
  16. 4/7 pull: remove support for `--rebase=preserve`Johannes Schindelin via GitGitGadget, Sep 1, 2021
  17. 3/7 tests: stop testing `git rebase --preserve-merges`Johannes Schindelin via GitGitGadget, Sep 1, 2021
  18. Ævar Arnfjörð BjarmasonSep 1, 2021
  19. 6/7 git-svn: drop support for `--preserve-merges`Johannes Schindelin via GitGitGadget, Sep 1, 2021
  20. Ævar Arnfjörð BjarmasonSep 1, 2021
  21. Johannes SchindelinSep 2, 2021
  22. Johannes SchindelinSep 2, 2021
  23. 5/7 rebase: drop support for `--preserve-merges`Johannes Schindelin via GitGitGadget, Sep 1, 2021
  24. Ævar Arnfjörð BjarmasonSep 1, 2021
  25. Johannes SchindelinSep 2, 2021
  26. Ævar Arnfjörð BjarmasonSep 2, 2021
  27. Ævar Arnfjörð BjarmasonSep 1, 2021
  28. Johannes SchindelinSep 2, 2021
  29. Ævar Arnfjörð BjarmasonSep 2, 2021
  30. Ævar Arnfjörð BjarmasonSep 2, 2021
  31. Ævar Arnfjörð BjarmasonSep 2, 2021
  32. Ævar Arnfjörð BjarmasonSep 2, 2021
  33. Ævar Arnfjörð BjarmasonSep 2, 2021
  34. Johannes SchindelinSep 4, 2021
  35. Ævar Arnfjörð BjarmasonSep 5, 2021
  36. Junio C HamanoSep 5, 2021
  37. Phillip WoodSep 6, 2021
  38. Johannes SchindelinSep 7, 2021
  39. Phillip WoodSep 7, 2021
  40. Johannes SchindelinSep 7, 2021
  41. 7/7 rebase: drop the internal `rebase--interactive` commandJohannes Schindelin via GitGitGadget, Sep 1, 2021
  42. Phillip WoodSep 6, 2021
  43. Johannes SchindelinSep 7, 2021
  44. Ævar Arnfjörð BjarmasonSep 1, 2021
  45. Johannes SchindelinSep 2, 2021
  46. Ævar Arnfjörð BjarmasonSep 2, 2021
  47. Junio C HamanoSep 1, 2021
  48. Johannes SchindelinSep 2, 2021
  49. Johannes SixtSep 2, 2021
  50. Johannes SchindelinSep 7, 2021
  51. Elijah NewrenSep 7, 2021
  52. Johannes SchindelinSep 10, 2021
  53. Elijah NewrenSep 10, 2021
  54. merge-ort and --rebase-merges, was Re: [PATCH v2 0/7] Drop support for git rebase --preserve-mergesJohannes Schindelin, Sep 13, 2021
  55. Elijah NewrenSep 13, 2021
  56. Ævar Arnfjörð BjarmasonSep 6, 2021
  57. Junio C HamanoSep 7, 2021
  58. Ævar Arnfjörð BjarmasonSep 7, 2021
  59. Alban GruinSep 4, 2021
  60. Phillip WoodSep 6, 2021
  61. Johannes SchindelinSep 7, 2021
  62. 00/11 Drop support for git rebase --preserve-mergesJohannes Schindelin via GitGitGadget, Sep 7, 2021
  63. 01/11 t5520: do not use `pull.rebase=preserve`Johannes Schindelin via GitGitGadget, Sep 7, 2021
  64. 02/11 remote: warn about unhandled branch.<name>.rebase valuesJohannes Schindelin via GitGitGadget, Sep 7, 2021
  65. 03/11 tests: stop testing `git rebase --preserve-merges`Johannes Schindelin via GitGitGadget, Sep 7, 2021
  66. 04/11 pull: remove support for `--rebase=preserve`Johannes Schindelin via GitGitGadget, Sep 7, 2021
  67. 06/11 git-svn: drop support for `--preserve-merges`Johannes Schindelin via GitGitGadget, Sep 7, 2021
  68. 05/11 rebase: drop support for `--preserve-merges`Johannes Schindelin via GitGitGadget, Sep 7, 2021
  69. Ævar Arnfjörð BjarmasonSep 10, 2021
  70. re-mentioning --preserve-merges in the docs (was: [PATCH v3 05/11] rebase: drop support for `--preserve-merges`)Ævar Arnfjörð Bjarmason, Jul 21, 2022
  71. Junio C HamanoJul 21, 2022
  72. Johannes SchindelinJul 29, 2022
  73. 07/11 rebase: drop the internal `rebase--interactive` commandJohannes Schindelin via GitGitGadget, Sep 7, 2021
  74. 08/11 rebase: remove obsolete code commentJohannes Schindelin via GitGitGadget, Sep 7, 2021
  75. 09/11 rebase: stop mentioning the -p option in commentsJohannes Schindelin via GitGitGadget, Sep 7, 2021
  76. 10/11 rebase: remove a no-longer-used functionJohannes Schindelin via GitGitGadget, Sep 7, 2021
  77. 11/11 sequencer: restrict scope of a formerly public functionJohannes Schindelin via GitGitGadget, Sep 7, 2021
  78. Ævar Arnfjörð BjarmasonSep 8, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.