summaryrefslogtreecommitdiff
path: root/merge-recursive.h
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2019-08-17 11:41:39 -0700
committerJunio C Hamano <gitster@pobox.com>2019-08-19 10:08:04 -0700
commita779fb829bf6160cb519500ac1e15d8ab8a247a4 (patch)
tree7d12bc458bf26dc5b9d90c10e55282ce2e86c8e7 /merge-recursive.h
parent8599ab4574ce3a8b2fc894c7cfdac8fd61450b7b (diff)
downloadgit-a779fb829bf6160cb519500ac1e15d8ab8a247a4.tar.gz
merge-recursive: comment and reorder the merge_options fields
The merge_options struct had lots of fields, making it a little imposing, but the options naturally fall into multiple different groups. Grouping similar options and adding a comment or two makes it easier to read, easier for new folks to figure out which options are related, and thus easier for them to find the options they need. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.h')
-rw-r--r--merge-recursive.h40
1 files changed, 26 insertions, 14 deletions
diff --git a/merge-recursive.h b/merge-recursive.h
index f4bdfbc897..9e040608fe 100644
--- a/merge-recursive.h
+++ b/merge-recursive.h
@@ -9,36 +9,48 @@ struct commit;
struct repository;
struct merge_options {
+ struct repository *repo;
+
+ /* ref names used in console messages and conflict markers */
const char *ancestor;
const char *branch1;
const char *branch2;
- enum {
- MERGE_RECURSIVE_NORMAL = 0,
- MERGE_RECURSIVE_OURS,
- MERGE_RECURSIVE_THEIRS
- } recursive_variant;
- const char *subtree_shift;
- unsigned buffer_output; /* 1: output at end, 2: keep buffered */
- unsigned renormalize : 1;
- long xdl_opts;
- int verbosity;
+
+ /* rename related options */
+ int detect_renames;
enum {
MERGE_DIRECTORY_RENAMES_NONE = 0,
MERGE_DIRECTORY_RENAMES_CONFLICT = 1,
MERGE_DIRECTORY_RENAMES_TRUE = 2
} detect_directory_renames;
- int detect_renames;
int rename_limit;
int rename_score;
- int needed_rename_limit;
int show_rename_progress;
+
+ /* xdiff-related options (patience, ignore whitespace, ours/theirs) */
+ long xdl_opts;
+ enum {
+ MERGE_RECURSIVE_NORMAL = 0,
+ MERGE_RECURSIVE_OURS,
+ MERGE_RECURSIVE_THEIRS
+ } recursive_variant;
+
+ /* console output related options */
+ int verbosity;
+ unsigned buffer_output; /* 1: output at end, 2: keep buffered */
+ struct strbuf obuf; /* output buffer */
+
+ /* miscellaneous control options */
+ const char *subtree_shift;
+ unsigned renormalize : 1;
+
+ /* internal fields used by the implementation (do NOT set these) */
int call_depth;
- struct strbuf obuf;
+ int needed_rename_limit;
struct hashmap current_file_dir_set;
struct string_list df_conflict_file_set;
struct unpack_trees_options unpack_opts;
struct index_state orig_index;
- struct repository *repo;
};
void init_merge_options(struct merge_options *opt, struct repository *repo);