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 /builtin | |
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>
Diffstat (limited to 'builtin')
-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 |
9 files changed, 34 insertions, 34 deletions
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]; |