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