Git fork

pull: remove support for `--rebase=preserve`

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>

authored by

Johannes Schindelin and committed by
Junio C Hamano
52f1e821 aa4df107

+8 -23
-4
Documentation/config/branch.txt
··· 85 85 so that the local merge commits are included in the rebase (see 86 86 linkgit:git-rebase[1] for details). 87 87 + 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 - + 92 88 When the value is `interactive` (or just 'i'), the rebase is run in interactive 93 89 mode. 94 90 +
-4
Documentation/config/pull.txt
··· 18 18 so that the local merge commits are included in the rebase (see 19 19 linkgit:git-rebase[1] for details). 20 20 + 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 - + 25 21 When the value is `interactive` (or just 'i'), the rebase is run in interactive 26 22 mode. 27 23 +
+1 -5
Documentation/git-pull.txt
··· 102 102 include::merge-options.txt[] 103 103 104 104 -r:: 105 - --rebase[=false|true|merges|preserve|interactive]:: 105 + --rebase[=false|true|merges|interactive]:: 106 106 When true, rebase the current branch on top of the upstream 107 107 branch after fetching. If there is a remote-tracking branch 108 108 corresponding to the upstream branch and the upstream branch ··· 112 112 When set to `merges`, rebase using `git rebase --rebase-merges` so that 113 113 the local merge commits are included in the rebase (see 114 114 linkgit:git-rebase[1] for details). 115 - + 116 - When set to `preserve` (deprecated in favor of `merges`), rebase with the 117 - `--preserve-merges` option passed to `git rebase` so that locally created 118 - merge commits will not be flattened. 119 115 + 120 116 When false, merge the upstream branch into the current branch. 121 117 +
+3 -6
builtin/pull.c
··· 30 30 /** 31 31 * Parses the value of --rebase. If value is a false value, returns 32 32 * REBASE_FALSE. If value is a true value, returns REBASE_TRUE. If value is 33 - * "merges", returns REBASE_MERGES. If value is "preserve", returns 34 - * REBASE_PRESERVE. If value is a invalid value, dies with a fatal error if 35 - * fatal is true, otherwise returns REBASE_INVALID. 33 + * "merges", returns REBASE_MERGES. If value is a invalid value, dies with 34 + * a fatal error if fatal is true, otherwise returns REBASE_INVALID. 36 35 */ 37 36 static enum rebase_type parse_config_rebase(const char *key, const char *value, 38 37 int fatal) ··· 126 125 /* Options passed to git-merge or git-rebase */ 127 126 OPT_GROUP(N_("Options related to merging")), 128 127 OPT_CALLBACK_F('r', "rebase", &opt_rebase, 129 - "(false|true|merges|preserve|interactive)", 128 + "(false|true|merges|interactive)", 130 129 N_("incorporate changes by rebasing rather than merging"), 131 130 PARSE_OPT_OPTARG, parse_opt_rebase), 132 131 OPT_PASSTHRU('n', NULL, &opt_diffstat, NULL, ··· 883 882 /* Options passed to git-rebase */ 884 883 if (opt_rebase == REBASE_MERGES) 885 884 strvec_push(&args, "--rebase-merges"); 886 - else if (opt_rebase == REBASE_PRESERVE) 887 - strvec_push(&args, "--preserve-merges"); 888 885 else if (opt_rebase == REBASE_INTERACTIVE) 889 886 strvec_push(&args, "--interactive"); 890 887 if (opt_diffstat)
+1 -1
contrib/completion/git-completion.bash
··· 2543 2543 return 2544 2544 ;; 2545 2545 branch.*.rebase) 2546 - __gitcomp "false true merges preserve interactive" "" "$cur_" 2546 + __gitcomp "false true merges interactive" "" "$cur_" 2547 2547 return 2548 2548 ;; 2549 2549 remote.pushdefault)
+3 -2
rebase.c
··· 1 1 #include "rebase.h" 2 2 #include "config.h" 3 + #include "gettext.h" 3 4 4 5 /* 5 6 * Parses textual value for pull.rebase, branch.<name>.rebase, etc. ··· 20 21 return REBASE_FALSE; 21 22 else if (v > 0) 22 23 return REBASE_TRUE; 23 - else if (!strcmp(value, "preserve") || !strcmp(value, "p")) 24 - return REBASE_PRESERVE; 25 24 else if (!strcmp(value, "merges") || !strcmp(value, "m")) 26 25 return REBASE_MERGES; 27 26 else if (!strcmp(value, "interactive") || !strcmp(value, "i")) 28 27 return REBASE_INTERACTIVE; 28 + else if (!strcmp(value, "preserve") || !strcmp(value, "p")) 29 + error(_("%s: 'preserve' superseded by 'merges'"), value); 29 30 /* 30 31 * Please update _git_config() in git-completion.bash when you 31 32 * add new rebase modes.
-1
rebase.h
··· 5 5 REBASE_INVALID = -1, 6 6 REBASE_FALSE = 0, 7 7 REBASE_TRUE, 8 - REBASE_PRESERVE, 9 8 REBASE_MERGES, 10 9 REBASE_INTERACTIVE 11 10 };