Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 90 lines (75 sloc) 2.291 kb
16da134 @dscho read-trees: refactor the unpack_trees() part
dscho authored
1 #ifndef UNPACK_TREES_H
2 #define UNPACK_TREES_H
3
7980872 @drizzd use persistent memory for rejected paths
drizzd authored
4 #include "string-list.h"
5
ca885a4 @gitster read-tree() and unpack_trees(): use consistent limit
gitster authored
6 #define MAX_UNPACK_TREES 8
7
16da134 @dscho read-trees: refactor the unpack_trees() part
dscho authored
8 struct unpack_trees_options;
08aefc9 @pclouds unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-c...
pclouds authored
9 struct exclude_list;
16da134 @dscho read-trees: refactor the unpack_trees() part
dscho authored
10
5828e83 diff-lib, read-tree, unpack-trees: mark cache_entry array paramters cons...
René Scharfe authored
11 typedef int (*merge_fn_t)(const struct cache_entry * const *src,
34110cd @torvalds Make 'unpack_trees()' have a separate source and destination index
torvalds authored
12 struct unpack_trees_options *options);
16da134 @dscho read-trees: refactor the unpack_trees() part
dscho authored
13
08353eb @moy Turn unpack_trees_options.msgs into an array + enum
moy authored
14 enum unpack_trees_error_types {
15 ERROR_WOULD_OVERWRITE = 0,
16 ERROR_NOT_UPTODATE_FILE,
17 ERROR_NOT_UPTODATE_DIR,
08402b0 @moy merge-recursive: distinguish "removed" and "overwritten" messages
moy authored
18 ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN,
19 ERROR_WOULD_LOSE_UNTRACKED_REMOVED,
08353eb @moy Turn unpack_trees_options.msgs into an array + enum
moy authored
20 ERROR_BIND_OVERLAP,
21 ERROR_SPARSE_NOT_UPTODATE_FILE,
08402b0 @moy merge-recursive: distinguish "removed" and "overwritten" messages
moy authored
22 ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN,
23 ERROR_WOULD_LOSE_ORPHANED_REMOVED,
08353eb @moy Turn unpack_trees_options.msgs into an array + enum
moy authored
24 NB_UNPACK_TREES_ERROR_TYPES
8ccba00 @gitster unpack-trees: allow Porcelain to give different error messages
gitster authored
25 };
26
dc1166e @moy Move set_porcelain_error_msgs to unpack-trees.c and rename it
moy authored
27 /*
28 * Sets the list of user-friendly error messages to be used by the
5e65ee3 @moy Move "show_all_errors = 1" to setup_unpack_trees_porcelain()
moy authored
29 * command "cmd" (either merge or checkout), and show_all_errors to 1.
dc1166e @moy Move set_porcelain_error_msgs to unpack-trees.c and rename it
moy authored
30 */
e294030 @moy setup_unpack_trees_porcelain: take the whole options struct as parameter
moy authored
31 void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
32 const char *cmd);
dc1166e @moy Move set_porcelain_error_msgs to unpack-trees.c and rename it
moy authored
33
16da134 @dscho read-trees: refactor the unpack_trees() part
dscho authored
34 struct unpack_trees_options {
5a56da5 @bebarino read-tree: migrate to parse-options
bebarino authored
35 unsigned int reset,
36 merge,
37 update,
38 index_only,
39 nontrivial_merge,
40 trivial_merges_only,
41 verbose_update,
42 aggressive,
43 skip_unmerged,
44 initial_checkout,
45 diff_index_cached,
ba655da @gitster read-tree --debug-unpack
gitster authored
46 debug_unpack,
08aefc9 @pclouds unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-c...
pclouds authored
47 skip_sparse_checkout,
e6c111b @moy unpack_trees: group error messages by type
moy authored
48 gently,
b419482 @gitster diff-index --quiet: learn the "stop feeding the backend early" logic
gitster authored
49 exiting_early,
2c9078d @jlehmann unpack-trees: add the dry_run flag to unpack_trees_options
jlehmann authored
50 show_all_errors,
51 dry_run;
16da134 @dscho read-trees: refactor the unpack_trees() part
dscho authored
52 const char *prefix;
da165f4 @gitster unpack-trees.c: prepare for looking ahead in the index
gitster authored
53 int cache_bottom;
f8a9d42 read-tree: further loosen "working file will be lost" check.
Junio C Hamano authored
54 struct dir_struct *dir;
40e3725 @gitster unpack-trees: allow pruning with pathspec
gitster authored
55 struct pathspec *pathspec;
16da134 @dscho read-trees: refactor the unpack_trees() part
dscho authored
56 merge_fn_t fn;
08353eb @moy Turn unpack_trees_options.msgs into an array + enum
moy authored
57 const char *msgs[NB_UNPACK_TREES_ERROR_TYPES];
e6c111b @moy unpack_trees: group error messages by type
moy authored
58 /*
59 * Store error messages in an array, each case
60 * corresponding to a error message type
61 */
7980872 @drizzd use persistent memory for rejected paths
drizzd authored
62 struct string_list unpack_rejects[NB_UNPACK_TREES_ERROR_TYPES];
16da134 @dscho read-trees: refactor the unpack_trees() part
dscho authored
63
64 int head_idx;
65 int merge_size;
66
67 struct cache_entry *df_conflict_entry;
d1f2d7e @torvalds Make run_diff_index() use unpack_trees(), not read_tree()
torvalds authored
68 void *unpack_data;
34110cd @torvalds Make 'unpack_trees()' have a separate source and destination index
torvalds authored
69
70 struct index_state *dst_index;
32260ad Make branch merging aware of underlying case-insensitive filsystems
Linus Torvalds authored
71 struct index_state *src_index;
34110cd @torvalds Make 'unpack_trees()' have a separate source and destination index
torvalds authored
72 struct index_state result;
08aefc9 @pclouds unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-c...
pclouds authored
73
74 struct exclude_list *el; /* for internal use */
16da134 @dscho read-trees: refactor the unpack_trees() part
dscho authored
75 };
76
933bf40 @torvalds Start moving unpack-trees to "struct tree_desc"
torvalds authored
77 extern int unpack_trees(unsigned n, struct tree_desc *t,
16da134 @dscho read-trees: refactor the unpack_trees() part
dscho authored
78 struct unpack_trees_options *options);
79
5828e83 diff-lib, read-tree, unpack-trees: mark cache_entry array paramters cons...
René Scharfe authored
80 int threeway_merge(const struct cache_entry * const *stages,
81 struct unpack_trees_options *o);
82 int twoway_merge(const struct cache_entry * const *src,
83 struct unpack_trees_options *o);
84 int bind_merge(const struct cache_entry * const *src,
85 struct unpack_trees_options *o);
86 int oneway_merge(const struct cache_entry * const *src,
87 struct unpack_trees_options *o);
076b0ad @dscho read-tree: move merge functions to the library
dscho authored
88
16da134 @dscho read-trees: refactor the unpack_trees() part
dscho authored
89 #endif
Something went wrong with that request. Please try again.