mirror of
https://github.com/git/git.git
synced 2024-11-24 02:17:02 +08:00
17e5574b04
This is the beginning of a new merge strategy. While there are some API differences, and the implementation has some differences in behavior, it is essentially meant as an eventual drop-in replacement for merge-recursive.c. However, it is being built to exist side-by-side with merge-recursive so that we have plenty of time to find out how those differences pan out in the real world while people can still fall back to merge-recursive. (Also, I intend to avoid modifying merge-recursive during this process, to keep it stable.) The primary difference noticable here is that the updating of the working tree and index is not done simultaneously with the merge algorithm, but is a separate post-processing step. The new API is designed so that one can do repeated merges (e.g. during a rebase or cherry-pick) and only update the index and working tree one time at the end instead of updating it with every intermediate result. Also, one can perform a merge between two branches, neither of which match the index or the working tree, without clobbering the index or working tree. The next three commits will demonstrate various uses of this new API. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
53 lines
1.3 KiB
C
53 lines
1.3 KiB
C
/*
|
|
* "Ostensibly Recursive's Twin" merge strategy, or "ort" for short. Meant
|
|
* as a drop-in replacement for the "recursive" merge strategy, allowing one
|
|
* to replace
|
|
*
|
|
* git merge [-s recursive]
|
|
*
|
|
* with
|
|
*
|
|
* git merge -s ort
|
|
*
|
|
* Note: git's parser allows the space between '-s' and its argument to be
|
|
* missing. (Should I have backronymed "ham", "alsa", "kip", "nap, "alvo",
|
|
* "cale", "peedy", or "ins" instead of "ort"?)
|
|
*/
|
|
|
|
#include "cache.h"
|
|
#include "merge-ort.h"
|
|
|
|
void merge_switch_to_result(struct merge_options *opt,
|
|
struct tree *head,
|
|
struct merge_result *result,
|
|
int update_worktree_and_index,
|
|
int display_update_msgs)
|
|
{
|
|
die("Not yet implemented");
|
|
merge_finalize(opt, result);
|
|
}
|
|
|
|
void merge_finalize(struct merge_options *opt,
|
|
struct merge_result *result)
|
|
{
|
|
die("Not yet implemented");
|
|
}
|
|
|
|
void merge_incore_nonrecursive(struct merge_options *opt,
|
|
struct tree *merge_base,
|
|
struct tree *side1,
|
|
struct tree *side2,
|
|
struct merge_result *result)
|
|
{
|
|
die("Not yet implemented");
|
|
}
|
|
|
|
void merge_incore_recursive(struct merge_options *opt,
|
|
struct commit_list *merge_bases,
|
|
struct commit *side1,
|
|
struct commit *side2,
|
|
struct merge_result *result)
|
|
{
|
|
die("Not yet implemented");
|
|
}
|