]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pull: remove support for `--rebase=preserve`
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 7 Sep 2021 21:05:05 +0000 (21:05 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Sep 2021 04:45:32 +0000 (21:45 -0700)
In preparation for `git-rebase--preserve-merges.sh` entering its after
life, we remove this (deprecated) option that would still rely on it.

To help users transition who still did not receive the memo about the
deprecation, we offer a helpful error message instead of throwing our
hands in the air and saying that we don't know that option, never heard
of 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>
Documentation/config/branch.txt
Documentation/config/pull.txt
Documentation/git-pull.txt
builtin/pull.c
contrib/completion/git-completion.bash
rebase.c
rebase.h

index cc5f3249fc58a39da1580b49ad0145c44ec1544f..d323d7327f6ba60b0a460019057f9dd188500873 100644 (file)
@@ -85,10 +85,6 @@ When `merges` (or just 'm'), pass the `--rebase-merges` option to 'git rebase'
 so that the local merge commits are included in the rebase (see
 linkgit:git-rebase[1] for details).
 +
-When `preserve` (or just 'p', deprecated in favor of `merges`), also pass
-`--preserve-merges` along to 'git rebase' so that locally committed merge
-commits will not be flattened by running 'git pull'.
-+
 When the value is `interactive` (or just 'i'), the rebase is run in interactive
 mode.
 +
index 5404830609569d78dbcd597847c86e4302123b75..9349e09261b25ce0d80b2543810fd4e8a3e08bf6 100644 (file)
@@ -18,10 +18,6 @@ When `merges` (or just 'm'), pass the `--rebase-merges` option to 'git rebase'
 so that the local merge commits are included in the rebase (see
 linkgit:git-rebase[1] for details).
 +
-When `preserve` (or just 'p', deprecated in favor of `merges`), also pass
-`--preserve-merges` along to 'git rebase' so that locally committed merge
-commits will not be flattened by running 'git pull'.
-+
 When the value is `interactive` (or just 'i'), the rebase is run in interactive
 mode.
 +
index 7f4b2d1982eab9080a5d37367192f88db7c45a10..7144690a0cbbae25bef34302947a9d591504aee6 100644 (file)
@@ -102,7 +102,7 @@ Options related to merging
 include::merge-options.txt[]
 
 -r::
---rebase[=false|true|merges|preserve|interactive]::
+--rebase[=false|true|merges|interactive]::
        When true, rebase the current branch on top of the upstream
        branch after fetching. If there is a remote-tracking branch
        corresponding to the upstream branch and the upstream branch
@@ -113,10 +113,6 @@ 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` (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 upstream branch into the current branch.
 +
 When `interactive`, enable the interactive mode of rebase.
index 3e13f8108432fe03b6cb5e10b4b3fe737e9db0f4..bda5c32ab6fbfa0f88dbefbe3bdc50ecdb75f959 100644 (file)
@@ -30,9 +30,8 @@
 /**
  * Parses the value of --rebase. If value is a false value, returns
  * REBASE_FALSE. If value is a true value, returns REBASE_TRUE. If value is
- * "merges", returns REBASE_MERGES. If value is "preserve", returns
- * REBASE_PRESERVE. If value is a invalid value, dies with a fatal error if
- * fatal is true, otherwise returns REBASE_INVALID.
+ * "merges", returns REBASE_MERGES. If value is a invalid value, dies with
+ * a fatal error if fatal is true, otherwise returns REBASE_INVALID.
  */
 static enum rebase_type parse_config_rebase(const char *key, const char *value,
                int fatal)
@@ -126,7 +125,7 @@ static struct option pull_options[] = {
        /* Options passed to git-merge or git-rebase */
        OPT_GROUP(N_("Options related to merging")),
        OPT_CALLBACK_F('r', "rebase", &opt_rebase,
-               "(false|true|merges|preserve|interactive)",
+               "(false|true|merges|interactive)",
                N_("incorporate changes by rebasing rather than merging"),
                PARSE_OPT_OPTARG, parse_opt_rebase),
        OPT_PASSTHRU('n', NULL, &opt_diffstat, NULL,
@@ -883,8 +882,6 @@ static int run_rebase(const struct object_id *newbase,
        /* Options passed to git-rebase */
        if (opt_rebase == REBASE_MERGES)
                strvec_push(&args, "--rebase-merges");
-       else if (opt_rebase == REBASE_PRESERVE)
-               strvec_push(&args, "--preserve-merges");
        else if (opt_rebase == REBASE_INTERACTIVE)
                strvec_push(&args, "--interactive");
        if (opt_diffstat)
index 4bdd27ddc8723638ee0bba3ead2326079b08f270..5dab8bd579e6ac52bc23b8e6d9f9b6675239a9e6 100644 (file)
@@ -2543,7 +2543,7 @@ __git_complete_config_variable_value ()
                return
                ;;
        branch.*.rebase)
-               __gitcomp "false true merges preserve interactive" "" "$cur_"
+               __gitcomp "false true merges interactive" "" "$cur_"
                return
                ;;
        remote.pushdefault)
index f8137d859b51114b75995f1c5c8f6cd282b1f3c4..6775cddb28434d0780cb483357476f4783e1f596 100644 (file)
--- a/rebase.c
+++ b/rebase.c
@@ -1,5 +1,6 @@
 #include "rebase.h"
 #include "config.h"
+#include "gettext.h"
 
 /*
  * Parses textual value for pull.rebase, branch.<name>.rebase, etc.
@@ -20,12 +21,12 @@ enum rebase_type rebase_parse_value(const char *value)
                return REBASE_FALSE;
        else if (v > 0)
                return REBASE_TRUE;
-       else if (!strcmp(value, "preserve") || !strcmp(value, "p"))
-               return REBASE_PRESERVE;
        else if (!strcmp(value, "merges") || !strcmp(value, "m"))
                return REBASE_MERGES;
        else if (!strcmp(value, "interactive") || !strcmp(value, "i"))
                return REBASE_INTERACTIVE;
+       else if (!strcmp(value, "preserve") || !strcmp(value, "p"))
+               error(_("%s: 'preserve' superseded by 'merges'"), value);
        /*
         * Please update _git_config() in git-completion.bash when you
         * add new rebase modes.
index cc723d4748952e4cf5e83b0b8835d2fd576dcf71..203b43728237454b4f0aa4fbb962d5e17f6b5855 100644 (file)
--- a/rebase.h
+++ b/rebase.h
@@ -5,7 +5,6 @@ enum rebase_type {
        REBASE_INVALID = -1,
        REBASE_FALSE = 0,
        REBASE_TRUE,
-       REBASE_PRESERVE,
        REBASE_MERGES,
        REBASE_INTERACTIVE
 };