summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2014-01-08 18:29:42 -0800
committerEdward Thomson <ethomson@microsoft.com>2014-01-20 17:15:11 -0500
commitc1d648c5c6361edfb1aa85a31656b628672c7616 (patch)
treef611ff05206f2305c82867514f1e7f22b602c7b7 /include/git2
parente49c98e6efaa444ed73ac3b8318a693801f93184 (diff)
downloadlibgit2-c1d648c5c6361edfb1aa85a31656b628672c7616.tar.gz
merge_file should use more aggressive levels
The default merge_file level was XDL_MERGE_MINIMAL, which will produce conflicts where there should not be in the case where both sides were changed identically. Change the defaults to be more aggressive (XDL_MERGE_ZEALOUS) which will more aggressively compress non-conflicts. This matches git.git's defaults. Increase testing around reverting a previously reverted commit to illustrate this problem.
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/merge.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/include/git2/merge.h b/include/git2/merge.h
index 8a1dfec2e..1888babd1 100644
--- a/include/git2/merge.h
+++ b/include/git2/merge.h
@@ -32,14 +32,21 @@ typedef enum {
} git_merge_tree_flag_t;
/**
- * Automerge options for `git_merge_trees_opts`.
+ * Merge file options for `git_merge_trees_opts`.
*/
typedef enum {
- GIT_MERGE_AUTOMERGE_NORMAL = 0,
- GIT_MERGE_AUTOMERGE_NONE = 1,
- GIT_MERGE_AUTOMERGE_FAVOR_OURS = 2,
- GIT_MERGE_AUTOMERGE_FAVOR_THEIRS = 3,
-} git_merge_automerge_flags;
+ /* Produce a conflict in a file when two similar regions are changed. */
+ GIT_MERGE_FILE_FAVOR_NORMAL = 0,
+
+ /* Do not attempt to produce an automerged file during tree merge. */
+ GIT_MERGE_FILE_FAVOR_NO_MERGE = 1,
+
+ /* Produce a file containing the "ours" side of conflicting regions. */
+ GIT_MERGE_FILE_FAVOR_OURS = 2,
+
+ /* Produce a file containing the "theirs" side of conflicting regions. */
+ GIT_MERGE_FILE_FAVOR_THEIRS = 3,
+} git_merge_file_favor_t;
typedef struct {
@@ -58,7 +65,7 @@ typedef struct {
git_diff_similarity_metric *metric;
/** Flags for automerging content. */
- git_merge_automerge_flags automerge_flags;
+ git_merge_file_favor_t file_favor;
} git_merge_tree_opts;
#define GIT_MERGE_TREE_OPTS_VERSION 1