Skip to content

Commit 2f16c1a

Browse files
committed
amend! rebase: drop support for --preserve-merges
rebase: drop support for `--preserve-merges` This option was deprecated in favor of `--rebase-merges` some time ago, and now we retire it. To assist users to transition away, we do not _actually_ remove the option, but now we no longer implement the functionality. Instead, we offer a helpful error message suggesting which option to use. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent f1fcaaf commit 2f16c1a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

builtin/rebase.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
10271027
char *squash_onto_name = NULL;
10281028
int reschedule_failed_exec = -1;
10291029
int allow_preemptive_ff = 1;
1030+
int preserve_merges_selected = 0;
10301031
struct option builtin_rebase_options[] = {
10311032
OPT_STRING(0, "onto", &options.onto_name,
10321033
N_("revision"),
@@ -1091,6 +1092,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
10911092
N_("let the user edit the list of commits to rebase"),
10921093
PARSE_OPT_NOARG | PARSE_OPT_NONEG,
10931094
parse_opt_interactive),
1095+
OPT_SET_INT_F('p', "preserve-merges", &preserve_merges_selected,
1096+
N_("(DEPRECATED) try to recreate merges instead of "
1097+
"ignoring them"),
1098+
1, PARSE_OPT_HIDDEN),
10941099
OPT_RERERE_AUTOUPDATE(&options.allow_rerere_autoupdate),
10951100
OPT_CALLBACK_F(0, "empty", &options, "{drop,keep,ask}",
10961101
N_("how to handle commits that become empty"),
@@ -1179,6 +1184,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
11791184
builtin_rebase_options,
11801185
builtin_rebase_usage, 0);
11811186

1187+
if (preserve_merges_selected)
1188+
die(_("--preserve-merges was replaced by --rebase-merges"));
1189+
11821190
if (action != ACTION_NONE && total_argc != 2) {
11831191
usage_with_options(builtin_rebase_usage,
11841192
builtin_rebase_options);

0 commit comments

Comments
 (0)