From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "Eric Wong" <e@80x24.org>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Johannes Sixt" <j6t@kdbg.org>,
"Alban Gruin" <alban.gruin@gmail.com>,
"Phillip Wood" <phillip.wood123@gmail.com>,
"Johannes Schindelin" <johannes.schindelin@gmx.de>
Subject: [PATCH v3 00/11] Drop support for git rebase --preserve-merges
Date: Tue, 07 Sep 2021 21:05:01 +0000 [thread overview]
Message-ID: <pull.195.v3.git.1631048712.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.195.v2.git.1630497435.gitgitgadget@gmail.com>
In 427c3bd28ab (rebase: deprecate --preserve-merges, 2019-03-11) (which was
included in v2.22.0), we officially deprecated the --preserve-merges
backend. Over two years later, it is time to drop that backend, and here is
a patch series that does just that.
Changes since v2:
* Removed the no-longer-needed script_snippet variable
* Enhanced the commit message of the git svn patch to clarify that the
deprecation happened only in v2.25 there
* Adjusted code comments that still talked about the removed option
* Removed some no-longer-needed ACTION_* enum values
* We now also drop check_todo_list_from_file() because it is no longer
needed
* The todo_list_add_exec_commands() function is now scoped to the file
(because there are no longer any outside users)
* When users still use the options, they are no longer met by Git's blank
stares, but by a helpful error message suggesting to use --rebase-merges
instead
Changes since v1:
* Rebased onto v2.33.0
Johannes Schindelin (11):
t5520: do not use `pull.rebase=preserve`
remote: warn about unhandled branch.<name>.rebase values
tests: stop testing `git rebase --preserve-merges`
pull: remove support for `--rebase=preserve`
rebase: drop support for `--preserve-merges`
git-svn: drop support for `--preserve-merges`
rebase: drop the internal `rebase--interactive` command
rebase: remove obsolete code comment
rebase: stop mentioning the -p option in comments
rebase: remove a no-longer-used function
sequencer: restrict scope of a formerly public function
.github/workflows/main.yml | 1 -
.gitignore | 1 -
Documentation/config/branch.txt | 4 -
Documentation/config/pull.txt | 4 -
Documentation/git-pull.txt | 6 +-
Documentation/git-rebase.txt | 51 -
Documentation/git-svn.txt | 1 -
Makefile | 2 -
builtin/pull.c | 9 +-
builtin/rebase.c | 335 +------
builtin/remote.c | 3 +
contrib/completion/git-completion.bash | 2 +-
git-rebase--preserve-merges.sh | 1057 ---------------------
git-svn.perl | 1 -
git.c | 1 -
rebase-interactive.c | 29 -
rebase-interactive.h | 2 -
rebase.c | 5 +-
rebase.h | 1 -
sequencer.c | 4 +-
sequencer.h | 2 -
t/t3404-rebase-interactive.sh | 76 --
t/t3408-rebase-multi-line.sh | 10 -
t/t3409-rebase-preserve-merges.sh | 130 ---
t/t3410-rebase-preserve-dropped-merges.sh | 90 --
t/t3411-rebase-preserve-around-merges.sh | 80 --
t/t3412-rebase-root.sh | 37 -
t/t3414-rebase-preserve-onto.sh | 85 --
t/t3418-rebase-continue.sh | 15 -
t/t3421-rebase-topology-linear.sh | 19 -
t/t3422-rebase-incompatible-options.sh | 11 -
t/t3425-rebase-topology-merges.sh | 151 ---
t/t3427-rebase-subtree.sh | 26 +-
t/t5520-pull.sh | 24 +-
t/t7505-prepare-commit-msg-hook.sh | 1 -
t/t7517-per-repo-email.sh | 13 -
t/test-lib.sh | 4 -
37 files changed, 33 insertions(+), 2260 deletions(-)
delete mode 100644 git-rebase--preserve-merges.sh
delete mode 100755 t/t3409-rebase-preserve-merges.sh
delete mode 100755 t/t3410-rebase-preserve-dropped-merges.sh
delete mode 100755 t/t3411-rebase-preserve-around-merges.sh
delete mode 100755 t/t3414-rebase-preserve-onto.sh
base-commit: 225bc32a989d7a22fa6addafd4ce7dcd04675dbf
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-195%2Fdscho%2Fdrop-rebase-p-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-195/dscho/drop-rebase-p-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/195
Range-diff vs v2:
1: 8da29d539fc = 1: 8da29d539fc t5520: do not use `pull.rebase=preserve`
2: acda0f59947 = 2: acda0f59947 remote: warn about unhandled branch.<name>.rebase values
3: cdb9fae4b93 ! 3: e4b683f0cd6 tests: stop testing `git rebase --preserve-merges`
@@ t/t3425-rebase-topology-merges.sh: test_run_rebase success 'd n o e' --apply
test_done
## t/t3427-rebase-subtree.sh ##
+@@ t/t3427-rebase-subtree.sh: commit_message() {
+ # where the root commit adds three files: topic_1.t, topic_2.t and topic_3.t.
+ #
+ # This commit history is then rebased onto `topic_3` with the
+-# `-Xsubtree=files_subtree` option in three different ways:
++# `-Xsubtree=files_subtree` option in two different ways:
+ #
+-# 1. using `--preserve-merges`
+-# 2. using `--preserve-merges` and --keep-empty
+-# 3. without specifying a rebase backend
++# 1. without specifying a rebase backend
++# 2. using the `--rebase-merges` backend
+
+ test_expect_success 'setup' '
+ test_commit README &&
@@ t/t3427-rebase-subtree.sh: test_expect_success 'setup' '
git commit -m "Empty commit" --allow-empty
'
4: b493046134d ! 4: 6e45e90abe5 pull: remove support for `--rebase=preserve`
@@ Commit message
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>
## Documentation/config/branch.txt ##
@@ contrib/completion/git-completion.bash: __git_complete_config_variable_value ()
remote.pushdefault)
## rebase.c ##
+@@
+ #include "rebase.h"
+ #include "config.h"
++#include "gettext.h"
+
+ /*
+ * Parses textual value for pull.rebase, branch.<name>.rebase, etc.
@@ rebase.c: enum rebase_type rebase_parse_value(const char *value)
return REBASE_FALSE;
else if (v > 0)
@@ rebase.c: enum rebase_type rebase_parse_value(const char *value)
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.
## rebase.h ##
@@ rebase.h: enum rebase_type {
5: eb738b1bf05 ! 5: 2d7a4a2c564 rebase: drop support for `--preserve-merges`
@@ Commit message
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 <johannes.schindelin@gmx.de>
## .gitignore ##
@@ builtin/rebase.c: static int run_am(struct rebase_options *opts)
{
- const char *argv[] = { NULL, NULL };
- struct strbuf script_snippet = STRBUF_INIT, buf = STRBUF_INIT;
-+ struct strbuf script_snippet = STRBUF_INIT;
int status;
- const char *backend, *backend_func;
@@ builtin/rebase.c: static int run_specific_rebase(struct rebase_options *opts, en
BUG("Unhandled rebase type %d", opts->type);
- break;
- }
-
+-
- strbuf_addf(&script_snippet,
- ". git-sh-setup && . %s && %s", backend, backend_func);
- argv[0] = script_snippet.buf;
--
+
- status = run_command_v_opt(argv, RUN_USING_SHELL);
-finished_rebase:
if (opts->dont_finish_rebase)
; /* do nothing */
else if (opts->type == REBASE_MERGE)
+@@ builtin/rebase.c: finished_rebase:
+ die("Nothing to do");
+ }
+
+- strbuf_release(&script_snippet);
+-
+ return status ? -1 : 0;
+ }
+
+@@ builtin/rebase.c: int cmd_rebase(int argc, const char **argv, const char *prefix)
+ char *squash_onto_name = NULL;
+ int reschedule_failed_exec = -1;
+ int allow_preemptive_ff = 1;
++ int preserve_merges_selected = 0;
+ struct option builtin_rebase_options[] = {
+ OPT_STRING(0, "onto", &options.onto_name,
+ N_("revision"),
@@ builtin/rebase.c: int cmd_rebase(int argc, const char **argv, const char *prefix)
N_("let the user edit the list of commits to rebase"),
PARSE_OPT_NOARG | PARSE_OPT_NONEG,
parse_opt_interactive),
- OPT_SET_INT_F('p', "preserve-merges", &options.type,
-- N_("(DEPRECATED) try to recreate merges instead of "
-- "ignoring them"),
++ OPT_SET_INT_F('p', "preserve-merges", &preserve_merges_selected,
+ N_("(DEPRECATED) try to recreate merges instead of "
+ "ignoring them"),
- REBASE_PRESERVE_MERGES, PARSE_OPT_HIDDEN),
++ 1, PARSE_OPT_HIDDEN),
OPT_RERERE_AUTOUPDATE(&options.allow_rerere_autoupdate),
OPT_CALLBACK_F(0, "empty", &options, "{drop,keep,ask}",
N_("how to handle commits that become empty"),
@@ builtin/rebase.c: int cmd_rebase(int argc, const char **argv, const char *prefix
} else {
strbuf_reset(&buf);
strbuf_addf(&buf, "%s/interactive", merge_dir());
+@@ builtin/rebase.c: int cmd_rebase(int argc, const char **argv, const char *prefix)
+ builtin_rebase_options,
+ builtin_rebase_usage, 0);
+
++ if (preserve_merges_selected)
++ die(_("--preserve-merges was replaced by --rebase-merges"));
++
+ if (action != ACTION_NONE && total_argc != 2) {
+ usage_with_options(builtin_rebase_usage,
+ builtin_rebase_options);
@@ builtin/rebase.c: int cmd_rebase(int argc, const char **argv, const char *prefix)
usage_with_options(builtin_rebase_usage,
builtin_rebase_options);
6: a987e9439af ! 6: 913647d8e76 git-svn: drop support for `--preserve-merges`
@@ Commit message
We already passed the `--rebase-merges` option to `git rebase` instead,
now we make this move permanent.
+ As pointed out by Ævar Arnfjörð Bjarmason, in contrast to the
+ deprecation of `git rebase`'s `--preserve-merges` backend, `git svn`
+ only deprecated this option in v2.25.0 (because this developer missed
+ `git svn`'s use of that backend when deprecating the rebase backend
+ running up to Git v2.22).
+
+ Still, v2.25.0 has been released on January 13th, 2020. In other words,
+ `git svn` deprecated this option over one and a half years ago, _and_
+ has been redirecting to the `--rebase-merges` option during all that
+ time (read: `git svn rebase --preserve-merges` didn't do _precisely_
+ what the user asked, since v2.25.0, anyway, it fell back to pretending
+ that the user asked for `git svn rebase --rebase-merges` instead).
+
+ It is time to act on that deprecation and remove that option after all.
+
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
## Documentation/git-svn.txt ##
7: 4492cca369c ! 7: b5a16e205e6 rebase: drop the internal `rebase--interactive` command
@@ Commit message
It was only used by the `--preserve-merges` backend, which we just
removed.
+ Helped-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
## builtin/rebase.c ##
+@@ builtin/rebase.c: enum action {
+ ACTION_ABORT,
+ ACTION_QUIT,
+ ACTION_EDIT_TODO,
+- ACTION_SHOW_CURRENT_PATCH,
+- ACTION_SHORTEN_OIDS,
+- ACTION_EXPAND_OIDS,
+- ACTION_CHECK_TODO_LIST,
+- ACTION_REARRANGE_SQUASH,
+- ACTION_ADD_EXEC
++ ACTION_SHOW_CURRENT_PATCH
+ };
+
+ static const char *action_names[] = { "undefined",
@@ builtin/rebase.c: static const char *action_names[] = { "undefined",
"edit_todo",
"show_current_patch" };
@@ builtin/rebase.c: static const char *action_names[] = { "undefined",
{
const char *todo_file = rebase_path_todo();
@@ builtin/rebase.c: static int run_sequencer_rebase(struct rebase_options *opts,
+ flags |= opts->rebase_merges ? TODO_LIST_REBASE_MERGES : 0;
+ flags |= opts->rebase_cousins > 0 ? TODO_LIST_REBASE_COUSINS : 0;
+ flags |= opts->root_with_onto ? TODO_LIST_ROOT_WITH_ONTO : 0;
+- flags |= command == ACTION_SHORTEN_OIDS ? TODO_LIST_SHORTEN_IDS : 0;
+ flags |= opts->reapply_cherry_picks ? TODO_LIST_REAPPLY_CHERRY_PICKS : 0;
+
+ switch (command) {
+@@ builtin/rebase.c: static int run_sequencer_rebase(struct rebase_options *opts,
break;
}
-: ----------- > 8: d23f245b684 rebase: remove obsolete code comment
-: ----------- > 9: 6905c8746ba rebase: stop mentioning the -p option in comments
-: ----------- > 10: 5bb04ea3f6c rebase: remove a no-longer-used function
-: ----------- > 11: aae9323b25f sequencer: restrict scope of a formerly public function
--
gitgitgadget
next prev parent reply other threads:[~2021-09-07 21:05 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-23 20:50 [PATCH 0/8] Drop support for git rebase --preserve-merges Johannes Schindelin via GitGitGadget
2019-11-23 20:50 ` [PATCH 1/8] t5520: do not use `pull.rebase=preserve` Johannes Schindelin via GitGitGadget
2019-11-23 20:50 ` [PATCH 2/8] remote: warn about unhandled branch.<name>.rebase values Johannes Schindelin via GitGitGadget
2019-11-23 20:50 ` [PATCH 3/8] tests: stop testing `git rebase --preserve-merges` Johannes Schindelin via GitGitGadget
2019-11-23 20:50 ` [PATCH 4/8] pull: remove support for `--rebase=preserve` Johannes Schindelin via GitGitGadget
2019-11-23 20:50 ` [PATCH 5/8] rebase: drop support for `--preserve-merges` Johannes Schindelin via GitGitGadget
2019-11-23 20:50 ` [PATCH 6/8] git-svn: " Johannes Schindelin via GitGitGadget
2019-11-23 22:08 ` Eric Wong
2019-11-24 21:29 ` Johannes Schindelin
2019-11-25 3:15 ` Eric Wong
2019-11-23 20:50 ` [PATCH 7/8] rebase: drop the internal `rebase--interactive` command Johannes Schindelin via GitGitGadget
2019-11-23 20:50 ` [PATCH 8/8] remote: no longer claim that branch.*.rebase=preserve is a thing Johannes Schindelin via GitGitGadget
2021-09-01 11:57 ` [PATCH v2 0/7] Drop support for git rebase --preserve-merges Johannes Schindelin via GitGitGadget
2021-09-01 11:57 ` [PATCH v2 1/7] t5520: do not use `pull.rebase=preserve` Johannes Schindelin via GitGitGadget
2021-09-01 11:57 ` [PATCH v2 2/7] remote: warn about unhandled branch.<name>.rebase values Johannes Schindelin via GitGitGadget
2021-09-01 11:57 ` [PATCH v2 3/7] tests: stop testing `git rebase --preserve-merges` Johannes Schindelin via GitGitGadget
2021-09-01 13:26 ` Ævar Arnfjörð Bjarmason
2021-09-01 11:57 ` [PATCH v2 4/7] pull: remove support for `--rebase=preserve` Johannes Schindelin via GitGitGadget
2021-09-01 11:57 ` [PATCH v2 5/7] rebase: drop support for `--preserve-merges` Johannes Schindelin via GitGitGadget
2021-09-01 12:21 ` Ævar Arnfjörð Bjarmason
2021-09-02 13:54 ` Johannes Schindelin
2021-09-02 14:11 ` Ævar Arnfjörð Bjarmason
2021-09-01 13:33 ` Ævar Arnfjörð Bjarmason
2021-09-02 13:59 ` Johannes Schindelin
2021-09-02 14:16 ` Ævar Arnfjörð Bjarmason
2021-09-02 14:28 ` Ævar Arnfjörð Bjarmason
2021-09-02 14:34 ` Ævar Arnfjörð Bjarmason
2021-09-02 14:56 ` Ævar Arnfjörð Bjarmason
2021-09-02 15:34 ` Ævar Arnfjörð Bjarmason
2021-09-04 19:41 ` Johannes Schindelin
2021-09-05 7:32 ` Ævar Arnfjörð Bjarmason
2021-09-05 22:36 ` Junio C Hamano
2021-09-06 10:15 ` Phillip Wood
2021-09-07 12:32 ` Johannes Schindelin
2021-09-07 15:31 ` Phillip Wood
2021-09-07 19:44 ` Johannes Schindelin
2021-09-01 11:57 ` [PATCH v2 6/7] git-svn: " Johannes Schindelin via GitGitGadget
2021-09-01 13:25 ` Ævar Arnfjörð Bjarmason
2021-09-02 14:00 ` Johannes Schindelin
2021-09-02 14:08 ` Johannes Schindelin
2021-09-01 11:57 ` [PATCH v2 7/7] rebase: drop the internal `rebase--interactive` command Johannes Schindelin via GitGitGadget
2021-09-06 10:10 ` Phillip Wood
2021-09-07 12:39 ` Johannes Schindelin
2021-09-01 13:37 ` [PATCH v2 0/7] Drop support for git rebase --preserve-merges Ævar Arnfjörð Bjarmason
2021-09-02 14:16 ` Johannes Schindelin
2021-09-02 14:51 ` Ævar Arnfjörð Bjarmason
2021-09-01 22:25 ` Junio C Hamano
2021-09-02 14:18 ` Johannes Schindelin
2021-09-02 20:06 ` Johannes Sixt
2021-09-07 17:33 ` Johannes Schindelin
2021-09-07 22:48 ` Elijah Newren
2021-09-10 12:08 ` Johannes Schindelin
2021-09-10 17:16 ` Elijah Newren
2021-09-13 11:24 ` merge-ort and --rebase-merges, was " Johannes Schindelin
2021-09-13 15:53 ` Elijah Newren
2021-09-06 6:58 ` Ævar Arnfjörð Bjarmason
2021-09-07 18:27 ` Junio C Hamano
2021-09-07 19:52 ` Ævar Arnfjörð Bjarmason
2021-09-04 22:30 ` Alban Gruin
2021-09-06 10:17 ` Phillip Wood
2021-09-07 12:48 ` Johannes Schindelin
2021-09-07 21:05 ` Johannes Schindelin via GitGitGadget [this message]
2021-09-07 21:05 ` [PATCH v3 01/11] t5520: do not use `pull.rebase=preserve` Johannes Schindelin via GitGitGadget
2021-09-07 21:05 ` [PATCH v3 02/11] remote: warn about unhandled branch.<name>.rebase values Johannes Schindelin via GitGitGadget
2021-09-07 21:05 ` [PATCH v3 03/11] tests: stop testing `git rebase --preserve-merges` Johannes Schindelin via GitGitGadget
2021-09-07 21:05 ` [PATCH v3 04/11] pull: remove support for `--rebase=preserve` Johannes Schindelin via GitGitGadget
2021-09-07 21:05 ` [PATCH v3 05/11] rebase: drop support for `--preserve-merges` Johannes Schindelin via GitGitGadget
2021-09-10 14:53 ` Ævar Arnfjörð Bjarmason
2022-07-21 19:02 ` re-mentioning --preserve-merges in the docs (was: [PATCH v3 05/11] rebase: drop support for `--preserve-merges`) Ævar Arnfjörð Bjarmason
2022-07-21 20:15 ` re-mentioning --preserve-merges in the docs Junio C Hamano
2022-07-29 13:24 ` Johannes Schindelin
2021-09-07 21:05 ` [PATCH v3 06/11] git-svn: drop support for `--preserve-merges` Johannes Schindelin via GitGitGadget
2021-09-07 21:05 ` [PATCH v3 07/11] rebase: drop the internal `rebase--interactive` command Johannes Schindelin via GitGitGadget
2021-09-07 21:05 ` [PATCH v3 08/11] rebase: remove obsolete code comment Johannes Schindelin via GitGitGadget
2021-09-07 21:05 ` [PATCH v3 09/11] rebase: stop mentioning the -p option in comments Johannes Schindelin via GitGitGadget
2021-09-07 21:05 ` [PATCH v3 10/11] rebase: remove a no-longer-used function Johannes Schindelin via GitGitGadget
2021-09-07 21:05 ` [PATCH v3 11/11] sequencer: restrict scope of a formerly public function Johannes Schindelin via GitGitGadget
2021-09-08 1:30 ` [PATCH v3 00/11] Drop support for git rebase --preserve-merges Ævar Arnfjörð Bjarmason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.195.v3.git.1631048712.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=alban.gruin@gmail.com \
--cc=avarab@gmail.com \
--cc=e@80x24.org \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=johannes.schindelin@gmx.de \
--cc=phillip.wood123@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).