From 2f7b9f9e55ca2d8fa23fe44678a0180f7e118c86 Mon Sep 17 00:00:00 2001 From: Philip Oakley Date: Sat, 4 Jun 2022 11:17:46 +0000 Subject: [PATCH 1/4] rebase.c: state preserve-merges has been removed Since feebd2d256 (rebase: hide --preserve-merges option, 2019-10-18) this option is now removed as stated in the subsequent release notes. Fix and reflow the option tip. Signed-off-by: Philip Oakley Signed-off-by: Junio C Hamano --- builtin/rebase.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index 27fde7bf28..7c1b9bd9b9 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1110,8 +1110,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) PARSE_OPT_NOARG | PARSE_OPT_NONEG, parse_opt_interactive), OPT_SET_INT_F('p', "preserve-merges", &preserve_merges_selected, - N_("(DEPRECATED) try to recreate merges instead of " - "ignoring them"), + N_("(REMOVED) was: try to recreate merges " + "instead of ignoring them"), 1, PARSE_OPT_HIDDEN), OPT_RERERE_AUTOUPDATE(&options.allow_rerere_autoupdate), OPT_CALLBACK_F(0, "empty", &options, "{drop,keep,ask}", From afd58a0d42b5385089799fdd66b555df7cc8a4b4 Mon Sep 17 00:00:00 2001 From: Philip Oakley Date: Sat, 4 Jun 2022 11:17:47 +0000 Subject: [PATCH 2/4] rebase: help users when dying with `preserve-merges` Git would die if a "rebase --preserve-merges" was in progress. Users could neither --quit, --abort, nor --continue the rebase. Make the `rebase --abort` option available to allow users to remove traces of any preserve-merges rebase, even if they had upgraded during a rebase. One trigger case was an unexpectedly difficult to resolve conflict, as reported on the `git-users` group. (https://groups.google.com/g/git-for-windows/c/3jMWbBlXXHM) Other potential use-cases include git-experts using the portable 'Git on a stick' to help users with an older git version. Signed-off-by: Philip Oakley Signed-off-by: Junio C Hamano --- builtin/rebase.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index 7c1b9bd9b9..a3bae89f64 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1182,8 +1182,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) } else if (is_directory(merge_dir())) { strbuf_reset(&buf); strbuf_addf(&buf, "%s/rewritten", merge_dir()); - if (is_directory(buf.buf)) { - die("`rebase -p` is no longer supported"); + if (!(action == ACTION_ABORT) && is_directory(buf.buf)) { + die("`rebase --preserve-merges` (-p) is no longer supported.\n" + "Use `git rebase --abort` to terminate current rebase.\n" + "Or downgrade to v2.33, or earlier, to complete the rebase."); } else { strbuf_reset(&buf); strbuf_addf(&buf, "%s/interactive", merge_dir()); From afea77a72a2e986dfa285b86c08ba51772579dad Mon Sep 17 00:00:00 2001 From: Philip Oakley Date: Sat, 4 Jun 2022 11:17:48 +0000 Subject: [PATCH 3/4] rebase: note `preserve` merges may be a pull config option The `--preserve-merges` option was removed by v2.34.0. However users may not be aware that it is also a Pull configuration option, which is still offered by major IDE vendors such as Visual Studio. Extend the `--preserve-merges` die message to also direct users to the possible use of the `preserve` option in the `pull.rebase` config. This is an additional 'belt and braces' information statement. Signed-off-by: Philip Oakley Signed-off-by: Junio C Hamano --- builtin/rebase.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index a3bae89f64..142a40fa99 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1207,7 +1207,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) builtin_rebase_usage, 0); if (preserve_merges_selected) - die(_("--preserve-merges was replaced by --rebase-merges")); + die(_("--preserve-merges was replaced by --rebase-merges\n" + "Note: Your `pull.rebase` configuration may also be set to 'preserve',\n" + "which is no longer supported; use 'merges' instead")); if (action != ACTION_NONE && total_argc != 2) { usage_with_options(builtin_rebase_usage, From f007713cb101dba76491f18459ae45085b6267a2 Mon Sep 17 00:00:00 2001 From: Philip Oakley Date: Sat, 4 Jun 2022 11:17:49 +0000 Subject: [PATCH 4/4] rebase: translate a die(preserve-merges) message This is a user facing message for a situation seen in the wild. Translate it. Signed-off-by: Philip Oakley Signed-off-by: Junio C Hamano --- builtin/rebase.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index 142a40fa99..4a969dca06 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1183,9 +1183,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) strbuf_reset(&buf); strbuf_addf(&buf, "%s/rewritten", merge_dir()); if (!(action == ACTION_ABORT) && is_directory(buf.buf)) { - die("`rebase --preserve-merges` (-p) is no longer supported.\n" + die(_("`rebase --preserve-merges` (-p) is no longer supported.\n" "Use `git rebase --abort` to terminate current rebase.\n" - "Or downgrade to v2.33, or earlier, to complete the rebase."); + "Or downgrade to v2.33, or earlier, to complete the rebase.")); } else { strbuf_reset(&buf); strbuf_addf(&buf, "%s/interactive", merge_dir());