merge: update documentation for {merge,diff}.renameLimit
[git/git.git] / merge-recursive.h
CommitLineData
e1b3a2ca
DB
1#ifndef MERGE_RECURSIVE_H
2#define MERGE_RECURSIVE_H
3
64b1abe9 4#include "unpack-trees.h"
696ee23c
MV
5#include "string-list.h"
6
8a2fce18 7struct merge_options {
4c5868f4 8 const char *ancestor;
8a2fce18
MV
9 const char *branch1;
10 const char *branch2;
8cc5b290 11 enum {
85e51b78 12 MERGE_RECURSIVE_NORMAL = 0,
8cc5b290 13 MERGE_RECURSIVE_OURS,
4b05548f 14 MERGE_RECURSIVE_THEIRS
8cc5b290 15 } recursive_variant;
85e51b78 16 const char *subtree_shift;
f1e2426b 17 unsigned buffer_output; /* 1: output at end, 2: keep buffered */
1bc0ab7c 18 unsigned renormalize : 1;
58a1ece4 19 long xdl_opts;
8a2fce18 20 int verbosity;
d2b11eca 21 int detect_rename;
8a2fce18
MV
22 int diff_rename_limit;
23 int merge_rename_limit;
10ae7526 24 int rename_score;
bf0ab10f 25 int needed_rename_limit;
99bfc669 26 int show_rename_progress;
5033639c 27 int call_depth;
c7d84924 28 struct strbuf obuf;
fc65b00d 29 struct hashmap current_file_dir_set;
70cc3d36 30 struct string_list df_conflict_file_set;
64b1abe9 31 struct unpack_trees_options unpack_opts;
a35edc84 32 struct index_state orig_index;
ea625cb0
EN
33};
34
7fe40b88
EN
35/*
36 * For dir_rename_entry, directory names are stored as a full path from the
37 * toplevel of the repository and do not include a trailing '/'. Also:
38 *
39 * dir: original name of directory being renamed
40 * non_unique_new_dir: if true, could not determine new_dir
41 * new_dir: final name of directory being renamed
42 * possible_new_dirs: temporary used to help determine new_dir; see comments
43 * in get_directory_renames() for details
44 */
45struct dir_rename_entry {
46 struct hashmap_entry ent; /* must be the first member! */
47 char *dir;
48 unsigned non_unique_new_dir:1;
49 struct strbuf new_dir;
50 struct string_list possible_new_dirs;
51};
52
e95ab70a
EN
53struct collision_entry {
54 struct hashmap_entry ent; /* must be the first member! */
55 char *target_file;
56 struct string_list source_files;
57 unsigned reported_already:1;
58};
59
8a2fce18
MV
60/* merge_trees() but with recursive ancestor consolidation */
61int merge_recursive(struct merge_options *o,
62 struct commit *h1,
e1b3a2ca 63 struct commit *h2,
e1b3a2ca
DB
64 struct commit_list *ancestors,
65 struct commit **result);
66
8a2fce18
MV
67/* rename-detecting three-way merge, no recursion */
68int merge_trees(struct merge_options *o,
69 struct tree *head,
e1b3a2ca
DB
70 struct tree *merge,
71 struct tree *common,
e1b3a2ca 72 struct tree **result);
e1b3a2ca 73
8a2fce18
MV
74/*
75 * "git-merge-recursive" can be fed trees; wrap them into
76 * virtual commits and call merge_recursive() proper.
77 */
78int merge_recursive_generic(struct merge_options *o,
4e8161a8 79 const struct object_id *head,
80 const struct object_id *merge,
8a2fce18 81 int num_ca,
4e8161a8 82 const struct object_id **ca,
8a2fce18
MV
83 struct commit **result);
84
85void init_merge_options(struct merge_options *o);
86struct tree *write_tree_from_memory(struct merge_options *o);
9047ebbc 87
635a7bb1
JN
88int parse_merge_opt(struct merge_options *out, const char *s);
89
e1b3a2ca 90#endif