Deprecate git rebase -p even more
cover Deprecate git rebase -p even more
Turns out that I forgot a couple of spots when I sent the patch series to deprecate git rebase -p earlier...
Johannes Schindelin (3):
tests: mark a couple more test cases as requiring rebase -p
docs: say that --rebase=preserve is deprecated rebase docs: recommend -r over -p
Documentation/git-pull.txt | 5 +++-- Documentation/git-rebase.txt | 5 +++-- t/t3422-rebase-incompatible-options.sh | 5 +++-- t/t3427-rebase-subtree.sh | 15 ++++++++++----- 4 files changed, 19 insertions(+), 11 deletions(-)
base-commit: aa25c82427ae70aebf3b8f970f2afd54e9a2a8c6
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-227%2Fdscho%2Fdeprecate-rebase-p-more-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-227/dscho/deprecate-rebase-p-more-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/227
Signature · 1 line
gitgitgadget
PATCH 1/3 tests: mark a couple more test cases as requiring `rebase -p`
From: Johannes Schindelin <[email protected]>
The --preserve-merges option has been deprecated, and as a consequence we started to mark test cases that require that option to be supported, in preparation for removing that support eventually.
Since we marked those test cases, a couple more crept into the test suite, and with this patch, we mark them, too.
--- t/t3422-rebase-incompatible-options.sh | 5 +++-- t/t3427-rebase-subtree.sh | 15 ++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-)
t/t3422-rebase-incompatible-options.sh +3 -2
@@ -65,12 +65,13 @@ test_rebase_am_only --ignore-whitespace test_rebase_am_only --committer-date-is-author-date test_rebase_am_only -C4 -test_expect_success '--preserve-merges incompatible with --signoff' ' +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 '--preserve-merges incompatible with --rebase-merges' ' +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 '
t/t3427-rebase-subtree.sh +10 -5
@@ -38,7 +38,8 @@ test_expect_success 'setup' ' ' # FAILURE: Does not preserve master4. -test_expect_failure 'Rebase -Xsubtree --preserve-merges --onto commit 4' ' +test_expect_failure REBASE_P \ + 'Rebase -Xsubtree --preserve-merges --onto commit 4' ' reset_rebase && git checkout -b rebase-preserve-merges-4 master && git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
@@ -48,7 +49,8 @@ test_expect_failure 'Rebase -Xsubtree --preserve-merges --onto commit 4' ' ' # FAILURE: Does not preserve master5. -test_expect_failure 'Rebase -Xsubtree --preserve-merges --onto commit 5' ' +test_expect_failure REBASE_P \ + 'Rebase -Xsubtree --preserve-merges --onto commit 5' ' reset_rebase && git checkout -b rebase-preserve-merges-5 master && git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
@@ -58,7 +60,8 @@ test_expect_failure 'Rebase -Xsubtree --preserve-merges --onto commit 5' ' ' # FAILURE: Does not preserve master4. -test_expect_failure 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit 4' ' +test_expect_failure REBASE_P \ + 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit 4' ' reset_rebase && git checkout -b rebase-keep-empty-4 master && git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
@@ -68,7 +71,8 @@ test_expect_failure 'Rebase -Xsubtree --keep-empty --preserve-merges --onto comm ' # FAILURE: Does not preserve master5. -test_expect_failure 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit 5' ' +test_expect_failure REBASE_P \ + 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit 5' ' reset_rebase && git checkout -b rebase-keep-empty-5 master && git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
@@ -78,7 +82,8 @@ test_expect_failure 'Rebase -Xsubtree --keep-empty --preserve-merges --onto comm ' # FAILURE: Does not preserve Empty. -test_expect_failure 'Rebase -Xsubtree --keep-empty --preserve-merges --onto empty commit' ' +test_expect_failure REBASE_P \ + 'Rebase -Xsubtree --keep-empty --preserve-merges --onto empty commit' ' reset_rebase && git checkout -b rebase-keep-empty-empty master && git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
Signature · 1 line
gitgitgadget
PATCH 2/3 docs: say that `--rebase=preserve` is deprecated
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
As of Git v2.22.0, the --preserve-merges backend of git rebase will be officially deprecated in favor of the --rebase-merges backend. Consequently, git pull --rebase=preserve will also be deprected. State this explicitly.
--- Documentation/git-pull.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/git-pull.txt +3 -2
@@ -112,8 +112,9 @@ When set to `merges`, rebase using `git rebase --rebase-merges` so that the local merge commits are included in the rebase (see linkgit:git-rebase[1] for details). + -When set to preserve, rebase with the `--preserve-merges` option passed -to `git rebase` so that locally created merge commits will not be flattened. +When set to `preserve` (deprecated in favor of `merges`), rebase with the +`--preserve-merges` option passed to `git rebase` so that locally created +merge commits will not be flattened. + When false, merge the current branch into the upstream branch. +
Signature · 1 line
gitgitgadget
PATCH 3/3 rebase docs: recommend `-r` over `-p`
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
The --preserve-merges option is now deprecated in favor of --rebase-merges; Let's stop recommending the former.
--- Documentation/git-rebase.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/git-rebase.txt +3 -2
@@ -675,7 +675,8 @@ $ git rebase -i HEAD~5 And move the first patch to the end of the list. -You might want to preserve merges, if you have a history like this: +You might want to recreate merge commits, e.g. if you have a history +like this: ------------------ X
@@ -689,7 +690,7 @@ Suppose you want to rebase the side branch starting at "A" to "Q". Make sure that the current HEAD is "B", and call ----------------------------- -$ git rebase -i -p --onto Q O +$ git rebase -i -r --onto Q O ----------------------------- Reordering and editing commits usually creates untested intermediate
Signature · 1 line
gitgitgadget