File: merge.h

package info (click to toggle)
python-pygit2 1.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,720 kB
  • sloc: ansic: 12,584; python: 9,337; sh: 205; makefile: 26
file content (96 lines) | stat: -rw-r--r-- 2,451 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#define GIT_MERGE_OPTIONS_VERSION 1

typedef enum {
	GIT_MERGE_FIND_RENAMES = 1,
	GIT_MERGE_FAIL_ON_CONFLICT = 2,
	GIT_MERGE_SKIP_REUC = 4,
	GIT_MERGE_NO_RECURSIVE = 8,
	GIT_MERGE_VIRTUAL_BASE = (1 << 4),
} git_merge_flag_t;

typedef enum {
	GIT_MERGE_FILE_FAVOR_NORMAL = 0,
	GIT_MERGE_FILE_FAVOR_OURS = 1,
	GIT_MERGE_FILE_FAVOR_THEIRS = 2,
	GIT_MERGE_FILE_FAVOR_UNION = 3,
} git_merge_file_favor_t;

typedef enum {
	GIT_MERGE_FILE_DEFAULT = 0,
	GIT_MERGE_FILE_STYLE_MERGE = 1,
	GIT_MERGE_FILE_STYLE_DIFF3 = 2,
	GIT_MERGE_FILE_SIMPLIFY_ALNUM = 4,
	GIT_MERGE_FILE_IGNORE_WHITESPACE = 8,
	GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE = 16,
	GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL = 32,
	GIT_MERGE_FILE_DIFF_PATIENCE = 64,
	GIT_MERGE_FILE_DIFF_MINIMAL = 128,
	GIT_MERGE_FILE_STYLE_ZDIFF3 = (1 << 8),
	GIT_MERGE_FILE_ACCEPT_CONFLICTS = (1 << 9),
} git_merge_file_flag_t;

typedef struct {
	unsigned int version;
	git_merge_flag_t flags;
	unsigned int rename_threshold;
	unsigned int target_limit;
	git_diff_similarity_metric *metric;
	unsigned int recursion_limit;
	const char *default_driver;
	git_merge_file_favor_t file_favor;
	git_merge_file_flag_t file_flags;
} git_merge_options;

typedef struct {
	unsigned int automergeable;
	const char *path;
	unsigned int mode;
	const char *ptr;
	size_t len;
} git_merge_file_result;

typedef struct {
	unsigned int version;
	const char *ancestor_label;
	const char *our_label;
	const char *their_label;
	git_merge_file_favor_t favor;
	git_merge_file_flag_t flags;
	unsigned short marker_size;
} git_merge_file_options;

int git_merge_options_init(
	git_merge_options *opts,
	unsigned int version);

int git_merge_commits(
	git_index **out,
	git_repository *repo,
	const git_commit *our_commit,
	const git_commit *their_commit,
	const git_merge_options *opts);

int git_merge_trees(
	git_index **out,
	git_repository *repo,
	const git_tree *ancestor_tree,
	const git_tree *our_tree,
	const git_tree *their_tree,
	const git_merge_options *opts);

int git_merge_file_from_index(
	git_merge_file_result *out,
	git_repository *repo,
	const git_index_entry *ancestor,
	const git_index_entry *ours,
	const git_index_entry *theirs,
	const git_merge_file_options *opts);

int git_merge(
	git_repository *repo,
	const git_annotated_commit **their_heads,
	size_t their_heads_len,
	const git_merge_options *merge_opts,
	const git_checkout_options *checkout_opts);

void git_merge_file_result_free(git_merge_file_result *result);