From 6958c94a2f8fa8321e1363f49f14496ed7425d19 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 20 Mar 2018 12:19:38 -0700 Subject: [PATCH] Revert "Merge branch 'js/rebase-recreate-merge' into next" This reverts commit 3d1671756f948dab40792285885f0298e561ee1b, reversing changes made to cdbbc66464dda2a012437c5ab188ca2bf9b7f593, in order to allow a clean reboot of the topic. cf. --- Documentation/config.txt | 8 - Documentation/git-pull.txt | 5 +- Documentation/git-rebase.txt | 14 +- builtin/pull.c | 14 +- builtin/rebase--helper.c | 13 +- builtin/remote.c | 2 - contrib/completion/git-completion.bash | 4 +- git-rebase--interactive.sh | 22 +- git-rebase.sh | 16 - refs.c | 3 +- sequencer.c | 739 +------------------------ sequencer.h | 7 - t/t3430-rebase-recreate-merges.sh | 208 ------- 13 files changed, 30 insertions(+), 1025 deletions(-) delete mode 100755 t/t3430-rebase-recreate-merges.sh diff --git a/Documentation/config.txt b/Documentation/config.txt index 7b4a2a8980..ce9102cea8 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1058,10 +1058,6 @@ branch..rebase:: "git pull" is run. See "pull.rebase" for doing this in a non branch-specific manner. + -When recreate, also pass `--recreate-merges` along to 'git rebase' -so that locally committed merge commits will not be flattened -by running 'git pull'. -+ When preserve, also pass `--preserve-merges` along to 'git rebase' so that locally committed merge commits will not be flattened by running 'git pull'. @@ -2620,10 +2616,6 @@ pull.rebase:: pull" is run. See "branch..rebase" for setting this on a per-branch basis. + -When recreate, also pass `--recreate-merges` along to 'git rebase' -so that locally committed merge commits will not be flattened -by running 'git pull'. -+ When preserve, also pass `--preserve-merges` along to 'git rebase' so that locally committed merge commits will not be flattened by running 'git pull'. diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt index b4f9f057ea..ce05b7a5b1 100644 --- a/Documentation/git-pull.txt +++ b/Documentation/git-pull.txt @@ -101,16 +101,13 @@ Options related to merging include::merge-options.txt[] -r:: ---rebase[=false|true|recreate|preserve|interactive]:: +--rebase[=false|true|preserve|interactive]:: When true, rebase the current branch on top of the upstream branch after fetching. If there is a remote-tracking branch corresponding to the upstream branch and the upstream branch was rebased since last fetched, the rebase uses that information to avoid rebasing non-local changes. + -When set to recreate, rebase with the `--recreate-merges` option passed -to `git rebase` so that locally created merge commits will not be flattened. -+ When set to preserve, rebase with the `--preserve-merges` option passed to `git rebase` so that locally created merge commits will not be flattened. + diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 2b85416f96..3277ca1432 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -378,17 +378,6 @@ The commit list format can be changed by setting the configuration option rebase.instructionFormat. A customized instruction format will automatically have the long commit hash prepended to the format. ---recreate-merges[=(rebase-cousins|no-rebase-cousins)]:: - Recreate merge commits instead of flattening the history by replaying - merges. Merge conflict resolutions or manual amendments to merge - commits are not recreated automatically, but have to be recreated - manually. -+ -By default, or when `no-rebase-cousins` was specified, commits which do not -have `` as direct ancestor keep their original branch point. -If the `rebase-cousins` mode is turned on, such commits are rebased onto -`` (or ``, if specified). - -p:: --preserve-merges:: Recreate merge commits instead of flattening the history by replaying @@ -791,8 +780,7 @@ BUGS The todo list presented by `--preserve-merges --interactive` does not represent the topology of the revision graph. Editing commits and rewording their commit messages should work fine, but attempts to -reorder commits tend to produce counterintuitive results. Use ---recreate-merges for a more faithful representation. +reorder commits tend to produce counterintuitive results. For example, an attempt to rearrange ------------ diff --git a/builtin/pull.c b/builtin/pull.c index 3d1cc60eed..e32d6cd5b4 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -27,16 +27,14 @@ enum rebase_type { REBASE_FALSE = 0, REBASE_TRUE, REBASE_PRESERVE, - REBASE_RECREATE, REBASE_INTERACTIVE }; /** * Parses the value of --rebase. If value is a false value, returns * REBASE_FALSE. If value is a true value, returns REBASE_TRUE. If value is - * "recreate", returns REBASE_RECREATE. If value is "preserve", returns - * REBASE_PRESERVE. If value is a invalid value, dies with a fatal error if - * fatal is true, otherwise returns REBASE_INVALID. + * "preserve", returns REBASE_PRESERVE. If value is a invalid value, dies with + * a fatal error if fatal is true, otherwise returns REBASE_INVALID. */ static enum rebase_type parse_config_rebase(const char *key, const char *value, int fatal) @@ -49,8 +47,6 @@ static enum rebase_type parse_config_rebase(const char *key, const char *value, return REBASE_TRUE; else if (!strcmp(value, "preserve")) return REBASE_PRESERVE; - else if (!strcmp(value, "recreate")) - return REBASE_RECREATE; else if (!strcmp(value, "interactive")) return REBASE_INTERACTIVE; @@ -134,7 +130,7 @@ static struct option pull_options[] = { /* Options passed to git-merge or git-rebase */ OPT_GROUP(N_("Options related to merging")), { OPTION_CALLBACK, 'r', "rebase", &opt_rebase, - "false|true|recreate|preserve|interactive", + "false|true|preserve|interactive", N_("incorporate changes by rebasing rather than merging"), PARSE_OPT_OPTARG, parse_opt_rebase }, OPT_PASSTHRU('n', NULL, &opt_diffstat, NULL, @@ -804,9 +800,7 @@ static int run_rebase(const struct object_id *curr_head, argv_push_verbosity(&args); /* Options passed to git-rebase */ - if (opt_rebase == REBASE_RECREATE) - argv_array_push(&args, "--recreate-merges"); - else if (opt_rebase == REBASE_PRESERVE) + if (opt_rebase == REBASE_PRESERVE) argv_array_push(&args, "--preserve-merges"); else if (opt_rebase == REBASE_INTERACTIVE) argv_array_push(&args, "--interactive"); diff --git a/builtin/rebase--helper.c b/builtin/rebase--helper.c index 5d1f12de57..ad074705bb 100644 --- a/builtin/rebase--helper.c +++ b/builtin/rebase--helper.c @@ -12,8 +12,8 @@ static const char * const builtin_rebase_helper_usage[] = { int cmd_rebase__helper(int argc, const char **argv, const char *prefix) { struct replay_opts opts = REPLAY_OPTS_INIT; - unsigned flags = 0, keep_empty = 0, recreate_merges = 0; - int abbreviate_commands = 0, rebase_cousins = -1; + unsigned flags = 0, keep_empty = 0; + int abbreviate_commands = 0; enum { CONTINUE = 1, ABORT, MAKE_SCRIPT, SHORTEN_OIDS, EXPAND_OIDS, CHECK_TODO_LIST, SKIP_UNNECESSARY_PICKS, REARRANGE_SQUASH, @@ -24,9 +24,6 @@ int cmd_rebase__helper(int argc, const char **argv, const char *prefix) OPT_BOOL(0, "keep-empty", &keep_empty, N_("keep empty commits")), OPT_BOOL(0, "allow-empty-message", &opts.allow_empty_message, N_("allow commits with empty messages")), - OPT_BOOL(0, "recreate-merges", &recreate_merges, N_("recreate merge commits")), - OPT_BOOL(0, "rebase-cousins", &rebase_cousins, - N_("keep original branch points of cousins")), OPT_CMDMODE(0, "continue", &command, N_("continue rebase"), CONTINUE), OPT_CMDMODE(0, "abort", &command, N_("abort rebase"), @@ -60,14 +57,8 @@ int cmd_rebase__helper(int argc, const char **argv, const char *prefix) flags |= keep_empty ? TODO_LIST_KEEP_EMPTY : 0; flags |= abbreviate_commands ? TODO_LIST_ABBREVIATE_CMDS : 0; - flags |= recreate_merges ? TODO_LIST_RECREATE_MERGES : 0; - flags |= rebase_cousins > 0 ? TODO_LIST_REBASE_COUSINS : 0; flags |= command == SHORTEN_OIDS ? TODO_LIST_SHORTEN_IDS : 0; - if (rebase_cousins >= 0 && !recreate_merges) - warning(_("--[no-]rebase-cousins has no effect without " - "--recreate-merges")); - if (command == CONTINUE && argc == 1) return !!sequencer_continue(&opts); if (command == ABORT && argc == 1) diff --git a/builtin/remote.c b/builtin/remote.c index 210890c8a8..805ffc05cd 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -306,8 +306,6 @@ static int config_read_branches(const char *key, const char *value, void *cb) info->rebase = v; else if (!strcmp(value, "preserve")) info->rebase = NORMAL_REBASE; - else if (!strcmp(value, "recreate")) - info->rebase = NORMAL_REBASE; else if (!strcmp(value, "interactive")) info->rebase = INTERACTIVE_REBASE; } diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index d345d1fe0c..6da95b8095 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1945,7 +1945,7 @@ _git_rebase () --*) __gitcomp " --onto --merge --strategy --interactive - --recreate-merges --preserve-merges --stat --no-stat + --preserve-merges --stat --no-stat --committer-date-is-author-date --ignore-date --ignore-whitespace --whitespace= --autosquash --no-autosquash @@ -2116,7 +2116,7 @@ _git_config () return ;; branch.*.rebase) - __gitcomp "false true recreate preserve interactive" + __gitcomp "false true preserve interactive" return ;; remote.pushdefault) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 47a9cb81b8..331c8dfeac 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -155,19 +155,13 @@ reschedule_last_action () { append_todo_help () { gettext " Commands: -p, pick = use commit -r, reword = use commit, but edit the commit message -e, edit = use commit, but stop for amending -s, squash = use commit, but meld into previous commit -f, fixup = like \"squash\", but discard this commit's log message -x, exec = run command (the rest of the line) using shell -d, drop = remove commit -l, label