Skip to content

Commit 223a1bf

Browse files
committed
Merge branch 'js/retire-preserve-merges'
The "--preserve-merges" option of "git rebase" has been removed. * js/retire-preserve-merges: sequencer: restrict scope of a formerly public function rebase: remove a no-longer-used function rebase: stop mentioning the -p option in comments rebase: remove obsolete code comment rebase: drop the internal `rebase--interactive` command git-svn: drop support for `--preserve-merges` rebase: drop support for `--preserve-merges` pull: remove support for `--rebase=preserve` tests: stop testing `git rebase --preserve-merges` remote: warn about unhandled branch.<name>.rebase values t5520: do not use `pull.rebase=preserve`
2 parents 0ef0809 + 17919c3 commit 223a1bf

37 files changed

+33
-2263
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ jobs:
198198
shell: bash
199199
env:
200200
NO_SVN_TESTS: 1
201-
GIT_TEST_SKIP_REBASE_P: 1
202201
run: ci/run-test-slice.sh ${{matrix.nr}} 10
203202
- name: ci/print-test-failures.sh
204203
if: failure()

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@
125125
/git-range-diff
126126
/git-read-tree
127127
/git-rebase
128-
/git-rebase--preserve-merges
129128
/git-receive-pack
130129
/git-reflog
131130
/git-remote

Documentation/config/branch.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ When `merges` (or just 'm'), pass the `--rebase-merges` option to 'git rebase'
8585
so that the local merge commits are included in the rebase (see
8686
linkgit:git-rebase[1] for details).
8787
+
88-
When `preserve` (or just 'p', deprecated in favor of `merges`), also pass
89-
`--preserve-merges` along to 'git rebase' so that locally committed merge
90-
commits will not be flattened by running 'git pull'.
91-
+
9288
When the value is `interactive` (or just 'i'), the rebase is run in interactive
9389
mode.
9490
+

Documentation/config/pull.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ When `merges` (or just 'm'), pass the `--rebase-merges` option to 'git rebase'
1818
so that the local merge commits are included in the rebase (see
1919
linkgit:git-rebase[1] for details).
2020
+
21-
When `preserve` (or just 'p', deprecated in favor of `merges`), also pass
22-
`--preserve-merges` along to 'git rebase' so that locally committed merge
23-
commits will not be flattened by running 'git pull'.
24-
+
2521
When the value is `interactive` (or just 'i'), the rebase is run in interactive
2622
mode.
2723
+

Documentation/git-pull.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Options related to merging
105105
include::merge-options.txt[]
106106

107107
-r::
108-
--rebase[=false|true|merges|preserve|interactive]::
108+
--rebase[=false|true|merges|interactive]::
109109
When true, rebase the current branch on top of the upstream
110110
branch after fetching. If there is a remote-tracking branch
111111
corresponding to the upstream branch and the upstream branch
@@ -116,10 +116,6 @@ When set to `merges`, rebase using `git rebase --rebase-merges` so that
116116
the local merge commits are included in the rebase (see
117117
linkgit:git-rebase[1] for details).
118118
+
119-
When set to `preserve` (deprecated in favor of `merges`), rebase with the
120-
`--preserve-merges` option passed to `git rebase` so that locally created
121-
merge commits will not be flattened.
122-
+
123119
When false, merge the upstream branch into the current branch.
124120
+
125121
When `interactive`, enable the interactive mode of rebase.

Documentation/git-rebase.txt

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -527,29 +527,12 @@ i.e. commits that would be excluded by linkgit:git-log[1]'s
527527
the `rebase-cousins` mode is turned on, such commits are instead rebased
528528
onto `<upstream>` (or `<onto>`, if specified).
529529
+
530-
The `--rebase-merges` mode is similar in spirit to the deprecated
531-
`--preserve-merges` but works with interactive rebases,
532-
where commits can be reordered, inserted and dropped at will.
533-
+
534530
It is currently only possible to recreate the merge commits using the
535531
`ort` merge strategy; different merge strategies can be used only via
536532
explicit `exec git merge -s <strategy> [...]` commands.
537533
+
538534
See also REBASING MERGES and INCOMPATIBLE OPTIONS below.
539535

540-
-p::
541-
--preserve-merges::
542-
[DEPRECATED: use `--rebase-merges` instead] Recreate merge commits
543-
instead of flattening the history by replaying commits a merge commit
544-
introduces. Merge conflict resolutions or manual amendments to merge
545-
commits are not preserved.
546-
+
547-
This uses the `--interactive` machinery internally, but combining it
548-
with the `--interactive` option explicitly is generally not a good
549-
idea unless you know what you are doing (see BUGS below).
550-
+
551-
See also INCOMPATIBLE OPTIONS below.
552-
553536
-x <cmd>::
554537
--exec <cmd>::
555538
Append "exec <cmd>" after each line creating a commit in the
@@ -581,9 +564,6 @@ See also INCOMPATIBLE OPTIONS below.
581564
the root commit(s) on a branch. When used with --onto, it
582565
will skip changes already contained in <newbase> (instead of
583566
<upstream>) whereas without --onto it will operate on every change.
584-
When used together with both --onto and --preserve-merges,
585-
'all' root commits will be rewritten to have <newbase> as parent
586-
instead.
587567
+
588568
See also INCOMPATIBLE OPTIONS below.
589569

@@ -645,7 +625,6 @@ are incompatible with the following options:
645625
* --allow-empty-message
646626
* --[no-]autosquash
647627
* --rebase-merges
648-
* --preserve-merges
649628
* --interactive
650629
* --exec
651630
* --no-keep-empty
@@ -656,13 +635,6 @@ are incompatible with the following options:
656635

657636
In addition, the following pairs of options are incompatible:
658637

659-
* --preserve-merges and --interactive
660-
* --preserve-merges and --signoff
661-
* --preserve-merges and --rebase-merges
662-
* --preserve-merges and --empty=
663-
* --preserve-merges and --ignore-whitespace
664-
* --preserve-merges and --committer-date-is-author-date
665-
* --preserve-merges and --ignore-date
666638
* --keep-base and --onto
667639
* --keep-base and --root
668640
* --fork-point and --root
@@ -1280,29 +1252,6 @@ CONFIGURATION
12801252
include::config/rebase.txt[]
12811253
include::config/sequencer.txt[]
12821254

1283-
BUGS
1284-
----
1285-
The todo list presented by the deprecated `--preserve-merges --interactive`
1286-
does not represent the topology of the revision graph (use `--rebase-merges`
1287-
instead). Editing commits and rewording their commit messages should work
1288-
fine, but attempts to reorder commits tend to produce counterintuitive results.
1289-
Use `--rebase-merges` in such scenarios instead.
1290-
1291-
For example, an attempt to rearrange
1292-
------------
1293-
1 --- 2 --- 3 --- 4 --- 5
1294-
------------
1295-
to
1296-
------------
1297-
1 --- 2 --- 4 --- 3 --- 5
1298-
------------
1299-
by moving the "pick 4" line will result in the following history:
1300-
------------
1301-
3
1302-
/
1303-
1 --- 2 --- 4 --- 5
1304-
------------
1305-
13061255
GIT
13071256
---
13081257
Part of the linkgit:git[1] suite

Documentation/git-svn.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,6 @@ config key: svn.authorsProg
678678
--strategy=<strategy>::
679679
-p::
680680
--rebase-merges::
681-
--preserve-merges (DEPRECATED)::
682681
These are only used with the 'dcommit' and 'rebase' commands.
683682
+
684683
Passed directly to 'git rebase' when using 'dcommit' if a

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,6 @@ SCRIPT_SH += git-submodule.sh
609609
SCRIPT_SH += git-web--browse.sh
610610

611611
SCRIPT_LIB += git-mergetool--lib
612-
SCRIPT_LIB += git-rebase--preserve-merges
613612
SCRIPT_LIB += git-sh-i18n
614613
SCRIPT_LIB += git-sh-setup
615614

@@ -2637,7 +2636,6 @@ XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \
26372636
--keyword=__ --keyword=N__ --keyword="__n:1,2"
26382637
LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
26392638
LOCALIZED_SH = $(SCRIPT_SH)
2640-
LOCALIZED_SH += git-rebase--preserve-merges.sh
26412639
LOCALIZED_SH += git-sh-setup.sh
26422640
LOCALIZED_PERL = $(SCRIPT_PERL)
26432641

builtin/pull.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
/**
3232
* Parses the value of --rebase. If value is a false value, returns
3333
* REBASE_FALSE. If value is a true value, returns REBASE_TRUE. If value is
34-
* "merges", returns REBASE_MERGES. If value is "preserve", returns
35-
* REBASE_PRESERVE. If value is a invalid value, dies with a fatal error if
36-
* fatal is true, otherwise returns REBASE_INVALID.
34+
* "merges", returns REBASE_MERGES. If value is a invalid value, dies with
35+
* a fatal error if fatal is true, otherwise returns REBASE_INVALID.
3736
*/
3837
static enum rebase_type parse_config_rebase(const char *key, const char *value,
3938
int fatal)
@@ -127,7 +126,7 @@ static struct option pull_options[] = {
127126
/* Options passed to git-merge or git-rebase */
128127
OPT_GROUP(N_("Options related to merging")),
129128
OPT_CALLBACK_F('r', "rebase", &opt_rebase,
130-
"(false|true|merges|preserve|interactive)",
129+
"(false|true|merges|interactive)",
131130
N_("incorporate changes by rebasing rather than merging"),
132131
PARSE_OPT_OPTARG, parse_opt_rebase),
133132
OPT_PASSTHRU('n', NULL, &opt_diffstat, NULL,
@@ -884,8 +883,6 @@ static int run_rebase(const struct object_id *newbase,
884883
/* Options passed to git-rebase */
885884
if (opt_rebase == REBASE_MERGES)
886885
strvec_push(&args, "--rebase-merges");
887-
else if (opt_rebase == REBASE_PRESERVE)
888-
strvec_push(&args, "--preserve-merges");
889886
else if (opt_rebase == REBASE_INTERACTIVE)
890887
strvec_push(&args, "--interactive");
891888
if (opt_diffstat)

0 commit comments

Comments
 (0)