Merge branch 'en/merge-ort-api-null-impl'

Preparation for a new merge strategy.

* en/merge-ort-api-null-impl:
  merge,rebase,revert: select ort or recursive by config or environment
  fast-rebase: demonstrate merge-ort's API via new test-tool command
  merge-ort-wrappers: new convience wrappers to mimic the old merge API
  merge-ort: barebones API of new merge strategy with empty implementation
This commit is contained in:
Junio C Hamano
2020-11-18 13:32:53 -08:00
13 changed files with 517 additions and 15 deletions

View File

@ -119,6 +119,7 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts)
struct replay_opts replay = REPLAY_OPTS_INIT;
replay.action = REPLAY_INTERACTIVE_REBASE;
replay.strategy = NULL;
sequencer_init_config(&replay);
replay.signoff = opts->signoff;
@ -136,7 +137,12 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts)
opts->committer_date_is_author_date;
replay.ignore_date = opts->ignore_date;
replay.gpg_sign = xstrdup_or_null(opts->gpg_sign_opt);
replay.strategy = opts->strategy;
if (opts->strategy)
replay.strategy = opts->strategy;
else if (!replay.strategy && replay.default_strategy) {
replay.strategy = replay.default_strategy;
replay.default_strategy = NULL;
}
if (opts->strategy_opts)
parse_strategy_opts(&replay, opts->strategy_opts);
@ -1771,6 +1777,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
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:
case REBASE_PRESERVE_MERGES: