1 #ifndef MERGE_RECURSIVE_H
2 #define MERGE_RECURSIVE_H
4 #include "unpack-trees.h"
5 #include "string-list.h"
12 MERGE_RECURSIVE_NORMAL
= 0,
14 MERGE_RECURSIVE_THEIRS
16 const char *subtree_shift
;
17 unsigned buffer_output
; /* 1: output at end, 2: keep buffered */
18 unsigned renormalize
: 1;
22 int diff_rename_limit
;
23 int merge_rename_limit
;
25 int needed_rename_limit
;
26 int show_rename_progress
;
29 struct hashmap current_file_dir_set
;
30 struct string_list df_conflict_file_set
;
31 struct unpack_trees_options unpack_opts
;
35 * For dir_rename_entry, directory names are stored as a full path from the
36 * toplevel of the repository and do not include a trailing '/'. Also:
38 * dir: original name of directory being renamed
39 * non_unique_new_dir: if true, could not determine new_dir
40 * new_dir: final name of directory being renamed
41 * possible_new_dirs: temporary used to help determine new_dir; see comments
42 * in get_directory_renames() for details
44 struct dir_rename_entry
{
45 struct hashmap_entry ent
; /* must be the first member! */
47 unsigned non_unique_new_dir
:1;
48 struct strbuf new_dir
;
49 struct string_list possible_new_dirs
;
52 struct collision_entry
{
53 struct hashmap_entry ent
; /* must be the first member! */
55 struct string_list source_files
;
56 unsigned reported_already
:1;
59 /* merge_trees() but with recursive ancestor consolidation */
60 int merge_recursive(struct merge_options
*o
,
63 struct commit_list
*ancestors
,
64 struct commit
**result
);
66 /* rename-detecting three-way merge, no recursion */
67 int merge_trees(struct merge_options
*o
,
71 struct tree
**result
);
74 * "git-merge-recursive" can be fed trees; wrap them into
75 * virtual commits and call merge_recursive() proper.
77 int merge_recursive_generic(struct merge_options
*o
,
78 const struct object_id
*head
,
79 const struct object_id
*merge
,
81 const struct object_id
**ca
,
82 struct commit
**result
);
84 void init_merge_options(struct merge_options
*o
);
85 struct tree
*write_tree_from_memory(struct merge_options
*o
);
87 int parse_merge_opt(struct merge_options
*out
, const char *s
);