https://github.com/git/git
Revision 61217a83bd7ff0ce9016eb4df9ded4fdf29a506c authored by Elijah Newren on 21 October 2020, 00:29:08 UTC, committed by Elijah Newren on 02 November 2020, 20:16:21 UTC
Allow the testsuite to run where it treats requests for "recursive" or
the default merge algorithm via consulting the environment variable
GIT_TEST_MERGE_ALGORITHM which is expected to either be "recursive" (the
old traditional algorithm) or "ort" (the new algorithm).

Also, allow folks to pick the new algorithm via config setting.  It
turns out builtin/merge.c already had a way to allow users to specify a
different default merge algorithm: pull.twohead.  Rather odd
configuration name (especially to be in the 'pull' namespace rather than
'merge') but it's there.  Add that same configuration to rebase,
cherry-pick, and revert.

This required updating the various callsites that called merge_trees()
or merge_recursive() to conditionally call the new API, so this serves
as another demonstration of what the new API looks and feels like.
There are almost certainly some callsites that have not yet been
modified to work with the new merge algorithm, but this represents the
ones that I have been testing with thus far.

Signed-off-by: Elijah Newren <newren@gmail.com>
1 parent fce0db8
Raw File
Tip revision: 61217a83bd7ff0ce9016eb4df9ded4fdf29a506c authored by Elijah Newren on 21 October 2020, 00:29:08 UTC
merge,rebase,revert: select ort or recursive by config or environment
Tip revision: 61217a8
reflog-walk.h
#ifndef REFLOG_WALK_H
#define REFLOG_WALK_H

#include "cache.h"

struct commit;
struct reflog_walk_info;

void init_reflog_walk(struct reflog_walk_info **info);
int add_reflog_for_walk(struct reflog_walk_info *info,
			struct commit *commit, const char *name);
void show_reflog_message(struct reflog_walk_info *info, int,
			 const struct date_mode *, int force_date);
void get_reflog_message(struct strbuf *sb,
			struct reflog_walk_info *reflog_info);
const char *get_reflog_ident(struct reflog_walk_info *reflog_info);
timestamp_t get_reflog_timestamp(struct reflog_walk_info *reflog_info);
void get_reflog_selector(struct strbuf *sb,
			 struct reflog_walk_info *reflog_info,
			 const struct date_mode *dmode, int force_date,
			 int shorten);

int reflog_walk_empty(struct reflog_walk_info *walk);

struct commit *next_reflog_entry(struct reflog_walk_info *reflog_info);

#endif
back to top