diff options
author | Vicent Marti <vicent@github.com> | 2014-01-20 16:26:04 -0800 |
---|---|---|
committer | Vicent Marti <vicent@github.com> | 2014-01-20 16:26:04 -0800 |
commit | af2b969b6f63dafa8c55b88cadbcc7631c2dd30b (patch) | |
tree | e55254b0dc5473e95227a189d8b37d1450a7c26a /include | |
parent | e49c98e6efaa444ed73ac3b8318a693801f93184 (diff) | |
parent | 0ef19fe14ce5a5f7b5ac90966a56997bf04ea5a9 (diff) | |
download | libgit2-af2b969b6f63dafa8c55b88cadbcc7631c2dd30b.tar.gz |
Merge pull request #2061 from ethomson/merge_improvements
Merge improvements
Diffstat (limited to 'include')
-rw-r--r-- | include/git2/checkout.h | 7 | ||||
-rw-r--r-- | include/git2/merge.h | 21 |
2 files changed, 21 insertions, 7 deletions
diff --git a/include/git2/checkout.h b/include/git2/checkout.h index b94a5e2ff..0faf4ab14 100644 --- a/include/git2/checkout.h +++ b/include/git2/checkout.h @@ -152,6 +152,12 @@ typedef enum { /** Don't overwrite ignored files that exist in the checkout target */ GIT_CHECKOUT_DONT_OVERWRITE_IGNORED = (1u << 19), + /** Write normal merge files for conflicts */ + GIT_CHECKOUT_CONFLICT_STYLE_MERGE = (1u << 20), + + /** Include common ancestor data in diff3 format files for conflicts */ + GIT_CHECKOUT_CONFLICT_STYLE_DIFF3 = (1u << 21), + /** * THE FOLLOWING OPTIONS ARE NOT YET IMPLEMENTED */ @@ -252,6 +258,7 @@ typedef struct git_checkout_opts { const char *target_directory; /** alternative checkout path to workdir */ + const char *ancestor_label; /** the name of the common ancestor side of conflicts */ const char *our_label; /** the name of the "our" side of conflicts */ const char *their_label; /** the name of the "their" side of conflicts */ } git_checkout_opts; diff --git a/include/git2/merge.h b/include/git2/merge.h index 8a1dfec2e..ad9b5e2ea 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, + + /* Produce a file containing the "ours" side of conflicting regions. */ + GIT_MERGE_FILE_FAVOR_OURS = 1, + + /* Produce a file containing the "theirs" side of conflicting regions. */ + GIT_MERGE_FILE_FAVOR_THEIRS = 2, + + /* Produce a file blending the sides in a union of conflicting regions */ + GIT_MERGE_FILE_FAVOR_UNION = 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 |