aboutsummaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-04-17 10:28:18 -0700
committerJunio C Hamano <gitster@pobox.com>2025-04-17 10:28:18 -0700
commitc3ebf18eb2deac595bd2550c1076247d8cbf2bc1 (patch)
treecbfe05bc8f89b8bde1e37b1a1e9cbfc3089f0f17 /builtin
parentMerge branch 'kn/blame-porcelain-unblamable' (diff)
parentbuiltin/{merge,rebase,revert}: remove GIT_TEST_MERGE_ALGORITHM (diff)
downloadgit-c3ebf18eb2deac595bd2550c1076247d8cbf2bc1.tar.gz
git-c3ebf18eb2deac595bd2550c1076247d8cbf2bc1.zip
Merge branch 'en/merge-recursive-debug'
Remove remnants of the recursive merge strategy backend, which was superseded by the ort merge strategy. * en/merge-recursive-debug: builtin/{merge,rebase,revert}: remove GIT_TEST_MERGE_ALGORITHM tests: remove GIT_TEST_MERGE_ALGORITHM and test_expect_merge_algorithm merge-recursive.[ch]: thoroughly debug these merge, sequencer: switch recursive merges over to ort sequencer: switch non-recursive merges over to ort merge-ort: enable diff-algorithms other than histogram builtin/merge-recursive: switch to using merge_ort_generic() checkout: replace merge_trees() with merge_ort_nonrecursive()
Diffstat (limited to 'builtin')
-rw-r--r--builtin/checkout.c10
-rw-r--r--builtin/merge-recursive.c4
-rw-r--r--builtin/merge.c23
-rw-r--r--builtin/rebase.c5
-rw-r--r--builtin/revert.c2
5 files changed, 10 insertions, 34 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 2e7486cf65..e69ea06713 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -17,7 +17,7 @@
#include "merge-ll.h"
#include "lockfile.h"
#include "mem-pool.h"
-#include "merge-recursive.h"
+#include "merge-ort-wrappers.h"
#include "object-name.h"
#include "object-store-ll.h"
#include "parse-options.h"
@@ -907,10 +907,10 @@ static int merge_working_tree(const struct checkout_opts *opts,
o.branch1 = new_branch_info->name;
o.branch2 = "local";
o.conflict_style = opts->conflict_style;
- ret = merge_trees(&o,
- new_tree,
- work,
- old_tree);
+ ret = merge_ort_nonrecursive(&o,
+ new_tree,
+ work,
+ old_tree);
if (ret < 0)
exit(128);
ret = reset_tree(new_tree,
diff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c
index abfc060e28..03b5100cfa 100644
--- a/builtin/merge-recursive.c
+++ b/builtin/merge-recursive.c
@@ -3,7 +3,7 @@
#include "advice.h"
#include "gettext.h"
#include "hash.h"
-#include "merge-recursive.h"
+#include "merge-ort-wrappers.h"
#include "object-name.h"
static const char builtin_merge_recursive_usage[] =
@@ -89,7 +89,7 @@ int cmd_merge_recursive(int argc,
if (o.verbosity >= 3)
printf(_("Merging %s with %s\n"), o.branch1, o.branch2);
- failed = merge_recursive_generic(&o, &h1, &h2, bases_count, bases, &result);
+ failed = merge_ort_generic(&o, &h1, &h2, bases_count, bases, &result);
free(better1);
free(better2);
diff --git a/builtin/merge.c b/builtin/merge.c
index ba9faf126a..9efd585842 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -39,7 +39,6 @@
#include "rerere.h"
#include "help.h"
#include "merge.h"
-#include "merge-recursive.h"
#include "merge-ort-wrappers.h"
#include "resolve-undo.h"
#include "remote.h"
@@ -171,7 +170,7 @@ static struct strategy *get_strategy(const char *name)
struct strategy *ret;
static struct cmdnames main_cmds = {0}, other_cmds = {0};
static int loaded;
- char *default_strategy = getenv("GIT_TEST_MERGE_ALGORITHM");
+ char *default_strategy = NULL;
if (!name)
return NULL;
@@ -750,12 +749,8 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
repo_hold_locked_index(the_repository, &lock,
LOCK_DIE_ON_ERROR);
- if (!strcmp(strategy, "ort"))
- clean = merge_ort_recursive(&o, head, remoteheads->item,
- reversed, &result);
- else
- clean = merge_recursive(&o, head, remoteheads->item,
- reversed, &result);
+ clean = merge_ort_recursive(&o, head, remoteheads->item,
+ reversed, &result);
free_commit_list(reversed);
strbuf_release(&o.obuf);
@@ -1316,12 +1311,6 @@ int cmd_merge(int argc,
if (branch)
skip_prefix(branch, "refs/heads/", &branch);
- if (!pull_twohead) {
- char *default_strategy = getenv("GIT_TEST_MERGE_ALGORITHM");
- if (default_strategy && !strcmp(default_strategy, "ort"))
- pull_twohead = xstrdup("ort");
- }
-
init_diff_ui_defaults();
git_config(git_merge_config, NULL);
@@ -1522,12 +1511,6 @@ int cmd_merge(int argc,
fast_forward = FF_NO;
}
- if (!use_strategies && !pull_twohead &&
- remoteheads && !remoteheads->next) {
- char *default_strategy = getenv("GIT_TEST_MERGE_ALGORITHM");
- if (default_strategy)
- append_strategy(get_strategy(default_strategy));
- }
if (!use_strategies) {
if (!remoteheads)
; /* already up-to-date */
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 19ad4df74f..965bd048a8 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1575,11 +1575,6 @@ int cmd_rebase(int argc,
options.default_backend);
}
- if (options.type == REBASE_MERGE &&
- !options.strategy &&
- getenv("GIT_TEST_MERGE_ALGORITHM"))
- options.strategy = xstrdup(getenv("GIT_TEST_MERGE_ALGORITHM"));
-
switch (options.type) {
case REBASE_MERGE:
options.state_dir = merge_dir();
diff --git a/builtin/revert.c b/builtin/revert.c
index aca6c293cd..2654f769a8 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -252,8 +252,6 @@ static int run_sequencer(int argc, const char **argv, const char *prefix,
free(opts->strategy);
opts->strategy = xstrdup_or_null(strategy);
}
- if (!opts->strategy && getenv("GIT_TEST_MERGE_ALGORITHM"))
- opts->strategy = xstrdup(getenv("GIT_TEST_MERGE_ALGORITHM"));
free(options);
if (cmd == 'q') {