diff options
author | Brandon Williams <bmwill@google.com> | 2017-10-31 11:19:11 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-01 11:51:40 +0900 |
commit | 0d1e0e7801bb2ae22036ad09f9f5cec17e08c48b (patch) | |
tree | 16c48f9b73752aca718be9778ebacbef0ef3d984 | |
parent | diff: remove DIFF_OPT_CLR macro (diff) | |
download | tgif-0d1e0e7801bb2ae22036ad09f9f5cec17e08c48b.tar.xz |
diff: make struct diff_flags members lowercase
Now that the flags stored in struct diff_flags are being accessed
directly and not through macros, change all struct members from being
uppercase to lowercase.
This conversion is done using the following semantic patch:
@@
expression E;
@@
- E.RECURSIVE
+ E.recursive
@@
expression E;
@@
- E.TREE_IN_RECURSIVE
+ E.tree_in_recursive
@@
expression E;
@@
- E.BINARY
+ E.binary
@@
expression E;
@@
- E.TEXT
+ E.text
@@
expression E;
@@
- E.FULL_INDEX
+ E.full_index
@@
expression E;
@@
- E.SILENT_ON_REMOVE
+ E.silent_on_remove
@@
expression E;
@@
- E.FIND_COPIES_HARDER
+ E.find_copies_harder
@@
expression E;
@@
- E.FOLLOW_RENAMES
+ E.follow_renames
@@
expression E;
@@
- E.RENAME_EMPTY
+ E.rename_empty
@@
expression E;
@@
- E.HAS_CHANGES
+ E.has_changes
@@
expression E;
@@
- E.QUICK
+ E.quick
@@
expression E;
@@
- E.NO_INDEX
+ E.no_index
@@
expression E;
@@
- E.ALLOW_EXTERNAL
+ E.allow_external
@@
expression E;
@@
- E.EXIT_WITH_STATUS
+ E.exit_with_status
@@
expression E;
@@
- E.REVERSE_DIFF
+ E.reverse_diff
@@
expression E;
@@
- E.CHECK_FAILED
+ E.check_failed
@@
expression E;
@@
- E.RELATIVE_NAME
+ E.relative_name
@@
expression E;
@@
- E.IGNORE_SUBMODULES
+ E.ignore_submodules
@@
expression E;
@@
- E.DIRSTAT_CUMULATIVE
+ E.dirstat_cumulative
@@
expression E;
@@
- E.DIRSTAT_BY_FILE
+ E.dirstat_by_file
@@
expression E;
@@
- E.ALLOW_TEXTCONV
+ E.allow_textconv
@@
expression E;
@@
- E.TEXTCONV_SET_VIA_CMDLINE
+ E.textconv_set_via_cmdline
@@
expression E;
@@
- E.DIFF_FROM_CONTENTS
+ E.diff_from_contents
@@
expression E;
@@
- E.DIRTY_SUBMODULES
+ E.dirty_submodules
@@
expression E;
@@
- E.IGNORE_UNTRACKED_IN_SUBMODULES
+ E.ignore_untracked_in_submodules
@@
expression E;
@@
- E.IGNORE_DIRTY_SUBMODULES
+ E.ignore_dirty_submodules
@@
expression E;
@@
- E.OVERRIDE_SUBMODULE_CONFIG
+ E.override_submodule_config
@@
expression E;
@@
- E.DIRSTAT_BY_LINE
+ E.dirstat_by_line
@@
expression E;
@@
- E.FUNCCONTEXT
+ E.funccontext
@@
expression E;
@@
- E.PICKAXE_IGNORE_CASE
+ E.pickaxe_ignore_case
@@
expression E;
@@
- E.DEFAULT_FOLLOW_RENAMES
+ E.default_follow_renames
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | blame.c | 16 | ||||
-rw-r--r-- | builtin/add.c | 4 | ||||
-rw-r--r-- | builtin/am.c | 10 | ||||
-rw-r--r-- | builtin/blame.c | 10 | ||||
-rw-r--r-- | builtin/commit.c | 4 | ||||
-rw-r--r-- | builtin/diff.c | 8 | ||||
-rw-r--r-- | builtin/fast-export.c | 2 | ||||
-rw-r--r-- | builtin/log.c | 26 | ||||
-rw-r--r-- | builtin/reset.c | 2 | ||||
-rw-r--r-- | builtin/rev-list.c | 2 | ||||
-rw-r--r-- | combine-diff.c | 10 | ||||
-rw-r--r-- | diff-lib.c | 22 | ||||
-rw-r--r-- | diff-no-index.c | 8 | ||||
-rw-r--r-- | diff.c | 170 | ||||
-rw-r--r-- | diff.h | 62 | ||||
-rw-r--r-- | diffcore-pickaxe.c | 8 | ||||
-rw-r--r-- | diffcore-rename.c | 6 | ||||
-rw-r--r-- | log-tree.c | 2 | ||||
-rw-r--r-- | merge-recursive.c | 4 | ||||
-rw-r--r-- | notes-merge.c | 4 | ||||
-rw-r--r-- | patch-ids.c | 2 | ||||
-rw-r--r-- | revision.c | 24 | ||||
-rw-r--r-- | submodule.c | 16 | ||||
-rw-r--r-- | tree-diff.c | 16 | ||||
-rw-r--r-- | wt-status.c | 18 |
25 files changed, 228 insertions, 228 deletions
@@ -209,7 +209,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt, switch (st.st_mode & S_IFMT) { case S_IFREG: - if (opt->flags.ALLOW_TEXTCONV && + if (opt->flags.allow_textconv && textconv_object(read_from, mode, &null_oid, 0, &buf_ptr, &buf_len)) strbuf_attach(&buf, buf_ptr, buf_len, buf_len + 1); else if (strbuf_read_file(&buf, read_from, st.st_size) != st.st_size) @@ -293,7 +293,7 @@ static void fill_origin_blob(struct diff_options *opt, unsigned long file_size; (*num_read_blob)++; - if (opt->flags.ALLOW_TEXTCONV && + if (opt->flags.allow_textconv && textconv_object(o->path, o->mode, &o->blob_oid, 1, &file->ptr, &file_size)) ; else @@ -541,7 +541,7 @@ static struct blame_origin *find_origin(struct commit *parent, * same and diff-tree is fairly efficient about this. */ diff_setup(&diff_opts); - diff_opts.flags.RECURSIVE = 1; + diff_opts.flags.recursive = 1; diff_opts.detect_rename = 0; diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT; paths[0] = origin->path; @@ -615,7 +615,7 @@ static struct blame_origin *find_rename(struct commit *parent, int i; diff_setup(&diff_opts); - diff_opts.flags.RECURSIVE = 1; + diff_opts.flags.recursive = 1; diff_opts.detect_rename = DIFF_DETECT_RENAME; diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT; diff_opts.single_follow = origin->path; @@ -1238,7 +1238,7 @@ static void find_copy_in_parent(struct blame_scoreboard *sb, return; /* nothing remains for this target */ diff_setup(&diff_opts); - diff_opts.flags.RECURSIVE = 1; + diff_opts.flags.recursive = 1; diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT; diff_setup_done(&diff_opts); @@ -1253,7 +1253,7 @@ static void find_copy_in_parent(struct blame_scoreboard *sb, if ((opt & PICKAXE_BLAME_COPY_HARDEST) || ((opt & PICKAXE_BLAME_COPY_HARDER) && (!porigin || strcmp(target->path, porigin->path)))) - diff_opts.flags.FIND_COPIES_HARDER = 1; + diff_opts.flags.find_copies_harder = 1; if (is_null_oid(&target->commit->object.oid)) do_diff_cache(&parent->tree->object.oid, &diff_opts); @@ -1262,7 +1262,7 @@ static void find_copy_in_parent(struct blame_scoreboard *sb, &target->commit->tree->object.oid, "", &diff_opts); - if (!diff_opts.flags.FIND_COPIES_HARDER) + if (!diff_opts.flags.find_copies_harder) diffcore_std(&diff_opts); do { @@ -1825,7 +1825,7 @@ void setup_scoreboard(struct blame_scoreboard *sb, const char *path, struct blam if (fill_blob_sha1_and_mode(o)) die(_("no such path %s in %s"), path, final_commit_name); - if (sb->revs->diffopt.flags.ALLOW_TEXTCONV && + if (sb->revs->diffopt.flags.allow_textconv && textconv_object(path, o->mode, &o->blob_oid, 1, (char **) &sb->final_buf, &sb->final_buf_size)) ; diff --git a/builtin/add.c b/builtin/add.c index e1d83b69ac..8d08e99e92 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -116,7 +116,7 @@ int add_files_to_cache(const char *prefix, rev.diffopt.output_format = DIFF_FORMAT_CALLBACK; rev.diffopt.format_callback = update_callback; rev.diffopt.format_callback_data = &data; - rev.diffopt.flags.OVERRIDE_SUBMODULE_CONFIG = 1; + rev.diffopt.flags.override_submodule_config = 1; rev.max_count = 0; /* do not compare unmerged paths with stage #2 */ run_diff_files(&rev, DIFF_RACY_IS_MODIFIED); clear_pathspec(&rev.prune_data); @@ -218,7 +218,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix) argc = setup_revisions(argc, argv, &rev, NULL); rev.diffopt.output_format = DIFF_FORMAT_PATCH; rev.diffopt.use_color = 0; - rev.diffopt.flags.IGNORE_DIRTY_SUBMODULES = 1; + rev.diffopt.flags.ignore_dirty_submodules = 1; out = open(file, O_CREAT | O_WRONLY, 0666); if (out < 0) die(_("Could not open '%s' for writing."), file); diff --git a/builtin/am.c b/builtin/am.c index 015425a0f8..b281d58f30 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -1157,9 +1157,9 @@ static int index_has_changes(struct strbuf *sb) struct diff_options opt; diff_setup(&opt); - opt.flags.EXIT_WITH_STATUS = 1; + opt.flags.exit_with_status = 1; if (!sb) - opt.flags.QUICK = 1; + opt.flags.quick = 1; do_diff_cache(&head, &opt); diffcore_std(&opt); for (i = 0; sb && i < diff_queued_diff.nr; i++) { @@ -1168,7 +1168,7 @@ static int index_has_changes(struct strbuf *sb) strbuf_addstr(sb, diff_queued_diff.queue[i]->two->path); } diff_flush(&opt); - return opt.flags.HAS_CHANGES != 0; + return opt.flags.has_changes != 0; } else { for (i = 0; sb && i < active_nr; i++) { if (i) @@ -1409,8 +1409,8 @@ static void write_commit_patch(const struct am_state *state, struct commit *comm rev_info.show_root_diff = 1; rev_info.diffopt.output_format = DIFF_FORMAT_PATCH; rev_info.no_commit_id = 1; - rev_info.diffopt.flags.BINARY = 1; - rev_info.diffopt.flags.FULL_INDEX = 1; + rev_info.diffopt.flags.binary = 1; + rev_info.diffopt.flags.full_index = 1; rev_info.diffopt.use_color = 0; rev_info.diffopt.file = fp; rev_info.diffopt.close_file = 1; diff --git a/builtin/blame.c b/builtin/blame.c index 79db9e849c..005f55aaa2 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -708,8 +708,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix) git_config(git_blame_config, &output_option); init_revisions(&revs, NULL); revs.date_mode = blame_date_mode; - revs.diffopt.flags.ALLOW_TEXTCONV = 1; - revs.diffopt.flags.FOLLOW_RENAMES = 1; + revs.diffopt.flags.allow_textconv = 1; + revs.diffopt.flags.follow_renames = 1; save_commit_buffer = 0; dashdash_pos = 0; @@ -734,9 +734,9 @@ int cmd_blame(int argc, const char **argv, const char *prefix) parse_revision_opt(&revs, &ctx, options, blame_opt_usage); } parse_done: - no_whole_file_rename = !revs.diffopt.flags.FOLLOW_RENAMES; + no_whole_file_rename = !revs.diffopt.flags.follow_renames; xdl_opts |= revs.diffopt.xdl_opts & XDF_INDENT_HEURISTIC; - revs.diffopt.flags.FOLLOW_RENAMES = 0; + revs.diffopt.flags.follow_renames = 0; argc = parse_options_end(&ctx); if (incremental || (output_option & OUTPUT_PORCELAIN)) { @@ -803,7 +803,7 @@ parse_done: } blame_date_width -= 1; /* strip the null */ - if (revs.diffopt.flags.FIND_COPIES_HARDER) + if (revs.diffopt.flags.find_copies_harder) opt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE | PICKAXE_BLAME_COPY_HARDER); diff --git a/builtin/commit.c b/builtin/commit.c index 960e7ac081..0f368ad814 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -913,10 +913,10 @@ static int prepare_to_commit(const char *index_file, const char *prefix, * be really confusing. */ struct diff_flags flags = DIFF_FLAGS_INIT; - flags.OVERRIDE_SUBMODULE_CONFIG = 1; + flags.override_submodule_config = 1; if (ignore_submodule_arg && !strcmp(ignore_submodule_arg, "all")) - flags.IGNORE_SUBMODULES = 1; + flags.ignore_submodules = 1; commitable = index_differs_from(parent, &flags, 1); } } diff --git a/builtin/diff.c b/builtin/diff.c index ed41eb5a5b..3476e95e1a 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -44,7 +44,7 @@ static void stuff_change(struct diff_options *opt, !oidcmp(old_oid, new_oid) && (old_mode == new_mode)) return; - if (opt->flags.REVERSE_DIFF) { + if (opt->flags.reverse_diff) { SWAP(old_mode, new_mode); SWAP(old_oid, new_oid); SWAP(old_path, new_path); @@ -350,8 +350,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix) rev.diffopt.stat_graph_width = -1; /* Default to let external and textconv be used */ - rev.diffopt.flags.ALLOW_EXTERNAL = 1; - rev.diffopt.flags.ALLOW_TEXTCONV = 1; + rev.diffopt.flags.allow_external = 1; + rev.diffopt.flags.allow_textconv = 1; if (nongit) die(_("Not a git repository")); @@ -361,7 +361,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix) diff_setup_done(&rev.diffopt); } - rev.diffopt.flags.RECURSIVE = 1; + rev.diffopt.flags.recursive = 1; setup_diff_pager(&rev.diffopt); diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 35c8fb65d7..72672665be 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -1066,7 +1066,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) die("revision walk setup failed"); revs.diffopt.format_callback = show_filemodify; revs.diffopt.format_callback_data = &paths_of_changed_objects; - revs.diffopt.flags.RECURSIVE = 1; + revs.diffopt.flags.recursive = 1; while ((commit = get_revision(&revs))) { if (has_unshown_parent(commit)) { add_object_array(&commit->object, NULL, &commits); diff --git a/builtin/log.c b/builtin/log.c index 4a24d3e481..f3d5a02bea 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -121,16 +121,16 @@ static void cmd_log_init_defaults(struct rev_info *rev) if (fmt_pretty) get_commit_format(fmt_pretty, rev); if (default_follow) - rev->diffopt.flags.DEFAULT_FOLLOW_RENAMES = 1; + rev->diffopt.flags.default_follow_renames = 1; rev->verbose_header = 1; - rev->diffopt.flags.RECURSIVE = 1; + rev->diffopt.flags.recursive = 1; rev->diffopt.stat_width = -1; /* use full terminal width */ rev->diffopt.stat_graph_width = -1; /* respect statGraphWidth config */ rev->abbrev_commit = default_abbrev_commit; rev->show_root_diff = default_show_root; rev->subject_prefix = fmt_patch_subject_prefix; rev->show_signature = default_show_signature; - rev->diffopt.flags.ALLOW_TEXTCONV = 1; + rev->diffopt.flags.allow_textconv = 1; if (default_date_mode) parse_date_format(default_date_mode, &rev->date_mode); @@ -181,7 +181,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, init_display_notes(&rev->notes_opt); if (rev->diffopt.pickaxe || rev->diffopt.filter || - rev->diffopt.flags.FOLLOW_RENAMES) + rev->diffopt.flags.follow_renames) rev->always_show_header = 0; if (source) @@ -391,7 +391,7 @@ static int cmd_log_walk(struct rev_info *rev) fclose(rev->diffopt.file); if (rev->diffopt.output_format & DIFF_FORMAT_CHECKDIFF && - rev->diffopt.flags.CHECK_FAILED) { + rev->diffopt.flags.check_failed) { return 02; } return diff_result_code(&rev->diffopt, 0); @@ -483,8 +483,8 @@ static int show_blob_object(const struct object_id *oid, struct rev_info *rev, c unsigned long size; fflush(rev->diffopt.file); - if (!rev->diffopt.flags.TEXTCONV_SET_VIA_CMDLINE || - !rev->diffopt.flags.ALLOW_TEXTCONV) + if (!rev->diffopt.flags.textconv_set_via_cmdline || + !rev->diffopt.flags.allow_textconv) return stream_blob_to_fd(1, oid, NULL, 0); if (get_oid_with_context(obj_name, GET_OID_RECORD_PATH, @@ -666,9 +666,9 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix) static void log_setup_revisions_tweak(struct rev_info *rev, struct setup_revision_opt *opt) { - if (rev->diffopt.flags.DEFAULT_FOLLOW_RENAMES && + if (rev->diffopt.flags.default_follow_renames && rev->prune_data.nr == 1) - rev->diffopt.flags.FOLLOW_RENAMES = 1; + rev->diffopt.flags.follow_renames = 1; /* Turn --cc/-c into -p --cc/-c when -p was not given */ if (!rev->diffopt.output_format && rev->combine_merges) @@ -1340,7 +1340,7 @@ static void prepare_bases(struct base_tree_info *bases, return; diff_setup(&diffopt); - diffopt.flags.RECURSIVE = 1; + diffopt.flags.recursive = 1; diff_setup_done(&diffopt); oidcpy(&bases->base_commit, &base->object.oid); @@ -1511,7 +1511,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) rev.verbose_header = 1; rev.diff = 1; rev.max_parents = 1; - rev.diffopt.flags.RECURSIVE = 1; + rev.diffopt.flags.recursive = 1; rev.subject_prefix = fmt_patch_subject_prefix; memset(&s_r_opt, 0, sizeof(s_r_opt)); s_r_opt.def = "HEAD"; @@ -1612,8 +1612,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) rev.zero_commit = zero_commit; - if (!rev.diffopt.flags.TEXT && !no_binary_diff) - rev.diffopt.flags.BINARY = 1; + if (!rev.diffopt.flags.text && !no_binary_diff) + rev.diffopt.flags.binary = 1; if (rev.show_notes) init_display_notes(&rev.notes_opt); diff --git a/builtin/reset.c b/builtin/reset.c index 206819ef15..4b313a0183 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -166,7 +166,7 @@ static int read_from_tree(const struct pathspec *pathspec, opt.output_format = DIFF_FORMAT_CALLBACK; opt.format_callback = update_index_from_diff; opt.format_callback_data = &intent_to_add; - opt.flags.OVERRIDE_SUBMODULE_CONFIG = 1; + opt.flags.override_submodule_config = 1; if (do_diff_cache(tree_oid, &opt)) return 1; diff --git a/builtin/rev-list.c b/builtin/rev-list.c index c62382171b..1d3b6b61bd 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -294,7 +294,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) if (revs.bisect) bisect_list = 1; - if (revs.diffopt.flags.QUICK) + if (revs.diffopt.flags.quick) info.flags |= REV_LIST_QUIET; for (i = 1 ; i < argc; i++) { const char *arg = argv[i]; diff --git a/combine-diff.c b/combine-diff.c index 5a3a8b49be..23f3d25e2a 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -898,7 +898,7 @@ static void show_combined_header(struct combine_diff_path *elem, int show_file_header) { struct diff_options *opt = &rev->diffopt; - int abbrev = opt->flags.FULL_INDEX ? GIT_SHA1_HEXSZ : DEFAULT_ABBREV; + int abbrev = opt->flags.full_index ? GIT_SHA1_HEXSZ : DEFAULT_ABBREV; const char *a_prefix = opt->a_prefix ? opt->a_prefix : "a/"; const char *b_prefix = opt->b_prefix ? opt->b_prefix : "b/"; const char *c_meta = diff_get_color_opt(opt, DIFF_METAINFO); @@ -987,7 +987,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent, userdiff = userdiff_find_by_path(elem->path); if (!userdiff) userdiff = userdiff_find_by_name("default"); - if (opt->flags.ALLOW_TEXTCONV) + if (opt->flags.allow_textconv) textconv = userdiff_get_textconv(userdiff); /* Read the result of merge first */ @@ -1413,8 +1413,8 @@ void diff_tree_combined(const struct object_id *oid, diffopts = *opt; copy_pathspec(&diffopts.pathspec, &opt->pathspec); - diffopts.flags.RECURSIVE = 1; - diffopts.flags.ALLOW_EXTERNAL = 0; + diffopts.flags.recursive = 1; + diffopts.flags.allow_external = 0; /* find set of paths that everybody touches * @@ -1435,7 +1435,7 @@ void diff_tree_combined(const struct object_id *oid, * NOTE please keep this semantically in sync with diffcore_std() */ need_generic_pathscan = opt->skip_stat_unmatch || - opt->flags.FOLLOW_RENAMES || + opt->flags.follow_renames || opt->break_opt != -1 || opt->detect_rename || opt->pickaxe || diff --git a/diff-lib.c b/diff-lib.c index f1cc3fd510..d373358a5a 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -72,14 +72,14 @@ static int match_stat_with_submodule(struct diff_options *diffopt, int changed = ce_match_stat(ce, st, ce_option); if (S_ISGITLINK(ce->ce_mode)) { struct diff_flags orig_flags = diffopt->flags; - if (!diffopt->flags.OVERRIDE_SUBMODULE_CONFIG) + if (!diffopt->flags.override_submodule_config) set_diffopt_flags_from_submodule_config(diffopt, ce->name); - if (diffopt->flags.IGNORE_SUBMODULES) + if (diffopt->flags.ignore_submodules) changed = 0; - else if (!diffopt->flags.IGNORE_DIRTY_SUBMODULES && - (!changed || diffopt->flags.DIRTY_SUBMODULES)) + else if (!diffopt->flags.ignore_dirty_submodules && + (!changed || diffopt->flags.dirty_submodules)) *dirty_submodule = is_submodule_modified(ce->name, - diffopt->flags.IGNORE_UNTRACKED_IN_SUBMODULES); + diffopt->flags.ignore_untracked_in_submodules); diffopt->flags = orig_flags; } return changed; @@ -229,7 +229,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option) if (!changed && !dirty_submodule) { ce_mark_uptodate(ce); - if (!revs->diffopt.flags.FIND_COPIES_HARDER) + if (!revs->diffopt.flags.find_copies_harder) continue; } oldmode = ce->ce_mode; @@ -363,7 +363,7 @@ static int show_modified(struct rev_info *revs, oldmode = old->ce_mode; if (mode == oldmode && !oidcmp(oid, &old->oid) && !dirty_submodule && - !revs->diffopt.flags.FIND_COPIES_HARDER) + !revs->diffopt.flags.find_copies_harder) return 0; diff_change(&revs->diffopt, oldmode, mode, @@ -494,7 +494,7 @@ static int diff_cache(struct rev_info *revs, opts.head_idx = 1; opts.index_only = cached; opts.diff_index_cached = (cached && - !revs->diffopt.flags.FIND_COPIES_HARDER); + !revs->diffopt.flags.find_copies_harder); opts.merge = 1; opts.fn = oneway_diff; opts.unpack_data = revs; @@ -545,12 +545,12 @@ int index_differs_from(const char *def, const struct diff_flags *flags, memset(&opt, 0, sizeof(opt)); opt.def = def; setup_revisions(0, NULL, &rev, &opt); - rev.diffopt.flags.QUICK = 1; - rev.diffopt.flags.EXIT_WITH_STATUS = 1; + rev.diffopt.flags.quick = 1; + rev.diffopt.flags.exit_with_status = 1; if (flags) diff_flags_or(&rev.diffopt.flags, flags); rev.diffopt.ita_invisible_in_index = ita_invisible_in_index; run_diff_index(&rev, 1); object_array_clear(&rev.pending); - return (rev.diffopt.flags.HAS_CHANGES != 0); + return (rev.diffopt.flags.has_changes != 0); } diff --git a/diff-no-index.c b/diff-no-index.c index a3e1943401..0ed5f0f496 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -184,7 +184,7 @@ static int queue_diff(struct diff_options *o, } else { struct diff_filespec *d1, *d2; - if (o->flags.REVERSE_DIFF) { + if (o->flags.reverse_diff) { SWAP(mode1, mode2); SWAP(name1, name2); } @@ -276,16 +276,16 @@ void diff_no_index(struct rev_info *revs, if (!revs->diffopt.output_format) revs->diffopt.output_format = DIFF_FORMAT_PATCH; - revs->diffopt.flags.NO_INDEX = 1; + revs->diffopt.flags.no_index = 1; - revs->diffopt.flags.RELATIVE_NAME = 1; + revs->diffopt.flags.relative_name = 1; revs->diffopt.prefix = prefix; revs->max_count = -2; diff_setup_done(&revs->diffopt); setup_diff_pager(&revs->diffopt); - revs->diffopt.flags.EXIT_WITH_STATUS = 1; + revs->diffopt.flags.exit_with_status = 1; if (queue_diff(&revs->diffopt, paths[0], paths[1])) exit(1); @@ -124,18 +124,18 @@ static int parse_dirstat_params(struct diff_options *options, const char *params for (i = 0; i < params.nr; i++) { const char *p = params.items[i].string; if (!strcmp(p, "changes")) { - options->flags.DIRSTAT_BY_LINE = 0; - options->flags.DIRSTAT_BY_FILE = 0; + options->flags.dirstat_by_line = 0; + options->flags.dirstat_by_file = 0; } else if (!strcmp(p, "lines")) { - options->flags.DIRSTAT_BY_LINE = 1; - options->flags.DIRSTAT_BY_FILE = 0; + options->flags.dirstat_by_line = 1; + options->flags.dirstat_by_file = 0; } else if (!strcmp(p, "files")) { - options->flags.DIRSTAT_BY_LINE = 0; - options->flags.DIRSTAT_BY_FILE = 1; + options->flags.dirstat_by_line = 0; + options->flags.dirstat_by_file = 1; } else if (!strcmp(p, "noncumulative")) { - options->flags.DIRSTAT_CUMULATIVE = 0; + options->flags.dirstat_cumulative = 0; } else if (!strcmp(p, "cumulative")) { - options->flags.DIRSTAT_CUMULATIVE = 1; + options->flags.dirstat_cumulative = 1; } else if (isdigit(*p)) { char *end; int permille = strtoul(p, &end, 10) * 10; @@ -1481,7 +1481,7 @@ static void emit_rewrite_diff(const char *name_a, struct emit_callback ecbdata; struct strbuf out = STRBUF_INIT; - if (diff_mnemonic_prefix && o->flags.REVERSE_DIFF) { + if (diff_mnemonic_prefix && o->flags.reverse_diff) { a_prefix = o->b_prefix; b_prefix = o->a_prefix; } else { @@ -2729,7 +2729,7 @@ static void show_dirstat(struct diff_options *options) dir.alloc = 0; dir.nr = 0; dir.permille = options->dirstat_permille; - dir.cumulative = options->flags.DIRSTAT_CUMULATIVE; + dir.cumulative = options->flags.dirstat_cumulative; changed = 0; for (i = 0; i < q->nr; i++) { @@ -2755,7 +2755,7 @@ static void show_dirstat(struct diff_options *options) goto found_damage; } - if (options->flags.DIRSTAT_BY_FILE) { + if (options->flags.dirstat_by_file) { /* * In --dirstat-by-file mode, we don't really need to * look at the actual file contents at all. @@ -2830,7 +2830,7 @@ static void show_dirstat_by_line(struct diffstat_t *data, struct diff_options *o dir.alloc = 0; dir.nr = 0; dir.permille = options->dirstat_permille; - dir.cumulative = options->flags.DIRSTAT_CUMULATIVE; + dir.cumulative = options->flags.dirstat_cumulative; changed = 0; for (i = 0; i < data->nr; i++) { @@ -3117,7 +3117,7 @@ static void builtin_diff(const char *name_a, const char *line_prefix = diff_line_prefix(o); diff_set_mnemonic_prefix(o, "a/", "b/"); - if (o->flags.REVERSE_DIFF) { + if (o->flags.reverse_diff) { a_prefix = o->b_prefix; b_prefix = o->a_prefix; } else { @@ -3141,7 +3141,7 @@ static void builtin_diff(const char *name_a, return; } - if (o->flags.ALLOW_TEXTCONV) { + if (o->flags.allow_textconv) { textconv_one = get_textconv(one); textconv_two = get_textconv(two); } @@ -3201,13 +3201,13 @@ static void builtin_diff(const char *name_a, header.len, 0); strbuf_reset(&header); goto free_ab_and_return; - } else if (!o->flags.TEXT && + } else if (!o->flags.text && ( (!textconv_one && diff_filespec_is_binary(one)) || (!textconv_two && diff_filespec_is_binary(two)) )) { struct strbuf sb = STRBUF_INIT; if (!one->data && !two->data && S_ISREG(one->mode) && S_ISREG(two->mode) && - !o->flags.BINARY) { + !o->flags.binary) { if (!oidcmp(&one->oid, &two->oid)) { if (must_show_header) emit_diff_symbol(o, DIFF_SYMBOL_HEADER, @@ -3236,7 +3236,7 @@ static void builtin_diff(const char *name_a, } emit_diff_symbol(o, DIFF_SYMBOL_HEADER, header.buf, header.len, 0); strbuf_reset(&header); - if (o->flags.BINARY) + if (o->flags.binary) emit_binary_diff(o, &mf1, &mf2); else { strbuf_addf(&sb, "%sBinary files %s and %s differ\n", @@ -3282,7 +3282,7 @@ static void builtin_diff(const char *name_a, xecfg.ctxlen = o->context; xecfg.interhunkctxlen = o->interhunkcontext; xecfg.flags = XDL_EMIT_FUNCNAMES; - if (o->flags.FUNCCONTEXT) + if (o->flags.funccontext) xecfg.flags |= XDL_EMIT_FUNCCONTEXT; if (pe) xdiff_set_find_func(&xecfg, pe->pattern, pe->cflags); @@ -3447,7 +3447,7 @@ static void builtin_checkdiff(const char *name_a, const char *name_b, diff_free_filespec_data(one); diff_free_filespec_data(two); if (data.status) - o->flags.CHECK_FAILED = 1; + o->flags.check_failed = 1; } struct diff_filespec *alloc_filespec(const char *path) @@ -3941,9 +3941,9 @@ static void fill_metainfo(struct strbuf *msg, *must_show_header = 0; } if (one && two && oidcmp(&one->oid, &two->oid)) { - int abbrev = o->flags.FULL_INDEX ? 40 : DEFAULT_ABBREV; + int abbrev = o->flags.full_index ? 40 : DEFAULT_ABBREV; - if (o->flags.BINARY) { + if (o->flags.binary) { mmfile_t mf; if ((!fill_mmfile(&mf, one) && diff_filespec_is_binary(one)) || (!fill_mmfile(&mf, two) && diff_filespec_is_binary(two))) @@ -3973,7 +3973,7 @@ static void run_diff_cmd(const char *pgm, int must_show_header = 0; - if (o->flags.ALLOW_EXTERNAL) { + if (o->flags.allow_external) { struct userdiff_driver *drv = userdiff_find_by_path(attr_path); if (drv && drv->external) pgm = drv->external; @@ -4053,7 +4053,7 @@ static void run_diff(struct diff_filepair *p, struct diff_options *o) if (o->prefix_length) strip_prefix(o->prefix_length, &name, &other); - if (!o->flags.ALLOW_EXTERNAL) + if (!o->flags.allow_external) pgm = NULL; if (DIFF_PAIR_UNMERGED(p)) { @@ -4152,7 +4152,7 @@ void diff_setup(struct diff_options *options) options->context = diff_context_default; options->interhunkcontext = diff_interhunk_context_default; options->ws_error_highlight = ws_error_highlight_default; - options->flags.RENAME_EMPTY = 1; + options->flags.rename_empty = 1; /* pathchange left =NULL by default */ options->change = diff_change; @@ -4203,14 +4203,14 @@ void diff_setup_done(struct diff_options *options) if (DIFF_XDL_TST(options, IGNORE_WHITESPACE) || DIFF_XDL_TST(options, IGNORE_WHITESPACE_CHANGE) || DIFF_XDL_TST(options, IGNORE_WHITESPACE_AT_EOL)) - options->flags.DIFF_FROM_CONTENTS = 1; + options->flags.diff_from_contents = 1; else - options->flags.DIFF_FROM_CONTENTS = 0; + options->flags.diff_from_contents = 0; - if (options->flags.FIND_COPIES_HARDER) + if (options->flags.find_copies_harder) options->detect_rename = DIFF_DETECT_COPY; - if (!options->flags.RELATIVE_NAME) + if (!options->flags.relative_name) options->prefix = NULL; if (options->prefix) options->prefix_length = strlen(options->prefix); @@ -4240,18 +4240,18 @@ void diff_setup_done(struct diff_options *options) DIFF_FORMAT_DIRSTAT | DIFF_FORMAT_SUMMARY | DIFF_FORMAT_CHECKDIFF)) - options->flags.RECURSIVE = 1; + options->flags.recursive = 1; /* * Also pickaxe would not work very well if you do not say recursive */ if (options->pickaxe) - options->flags.RECURSIVE = 1; + options->flags.recursive = 1; /* * When patches are generated, submodules diffed against the work tree * must be checked for dirtiness too so it can be shown in the output */ if (options->output_format & DIFF_FORMAT_PATCH) - options->flags.DIRTY_SUBMODULES = 1; + options->flags.dirty_submodules = 1; if (options->detect_rename && options->rename_limit < 0) options->rename_limit = diff_rename_limit_default; @@ -4273,14 +4273,14 @@ void diff_setup_done(struct diff_options *options) * to have found. It does not make sense not to return with * exit code in such a case either. */ - if (options->flags.QUICK) { + if (options->flags.quick) { options->output_format = DIFF_FORMAT_NO_OUTPUT; - options->flags.EXIT_WITH_STATUS = 1; + options->flags.exit_with_status = 1; } options->diff_path_counter = 0; - if (options->flags.FOLLOW_RENAMES && options->pathspec.nr != 1) + if (options->flags.follow_renames && options->pathspec.nr != 1) die(_("--follow requires exactly one pathspec")); if (!options->use_color || external_diff()) @@ -4630,7 +4630,7 @@ int diff_opt_parse(struct diff_options *options, else if (starts_with(arg, "-C") || starts_with(arg, "--find-copies=") || !strcmp(arg, "--find-copies")) { if (options->detect_rename == DIFF_DETECT_COPY) - options->flags.FIND_COPIES_HARDER = 1; + options->flags.find_copies_harder = 1; if ((options->rename_score = diff_scoreopt_parse(arg)) == -1) return error("invalid argument to -C: %s", arg+2); options->detect_rename = DIFF_DETECT_COPY; @@ -4638,13 +4638,13 @@ int diff_opt_parse(struct diff_options *options, else if (!strcmp(arg, "--no-renames")) options->detect_rename = 0; else if (!strcmp(arg, "--rename-empty")) - options->flags.RENAME_EMPTY = 1; + options->flags.rename_empty = 1; else if (!strcmp(arg, "--no-rename-empty")) - options->flags.RENAME_EMPTY = 0; + options->flags.rename_empty = 0; else if (!strcmp(arg, "--relative")) - options->flags.RELATIVE_NAME = 1; + options->flags |