Merge branch 'bw/diff-opt-impl-to-bitfields'
A single-word "unsigned flags" in the diff options is being split into a structure with many bitfields. * bw/diff-opt-impl-to-bitfields: diff: make struct diff_flags members lowercase diff: remove DIFF_OPT_CLR macro diff: remove DIFF_OPT_SET macro diff: remove DIFF_OPT_TST macro diff: remove touched flags diff: add flag to indicate textconv was set via cmdline diff: convert flags to be stored in bitfields add, reset: use DIFF_OPT_SET macro to set a diff flag
This commit is contained in:
24
revision.c
24
revision.c
@ -419,7 +419,7 @@ static void file_add_remove(struct diff_options *options,
|
||||
|
||||
tree_difference |= diff;
|
||||
if (!revs->remove_empty_trees || tree_difference != REV_TREE_NEW)
|
||||
DIFF_OPT_SET(options, HAS_CHANGES);
|
||||
options->flags.has_changes = 1;
|
||||
}
|
||||
|
||||
static void file_change(struct diff_options *options,
|
||||
@ -431,7 +431,7 @@ static void file_change(struct diff_options *options,
|
||||
unsigned old_dirty_submodule, unsigned new_dirty_submodule)
|
||||
{
|
||||
tree_difference = REV_TREE_DIFFERENT;
|
||||
DIFF_OPT_SET(options, HAS_CHANGES);
|
||||
options->flags.has_changes = 1;
|
||||
}
|
||||
|
||||
static int rev_compare_tree(struct rev_info *revs,
|
||||
@ -464,7 +464,7 @@ static int rev_compare_tree(struct rev_info *revs,
|
||||
}
|
||||
|
||||
tree_difference = REV_TREE_SAME;
|
||||
DIFF_OPT_CLR(&revs->pruning, HAS_CHANGES);
|
||||
revs->pruning.flags.has_changes = 0;
|
||||
if (diff_tree_oid(&t1->object.oid, &t2->object.oid, "",
|
||||
&revs->pruning) < 0)
|
||||
return REV_TREE_DIFFERENT;
|
||||
@ -480,7 +480,7 @@ static int rev_same_tree_as_empty(struct rev_info *revs, struct commit *commit)
|
||||
return 0;
|
||||
|
||||
tree_difference = REV_TREE_SAME;
|
||||
DIFF_OPT_CLR(&revs->pruning, HAS_CHANGES);
|
||||
revs->pruning.flags.has_changes = 0;
|
||||
retval = diff_tree_oid(NULL, &t1->object.oid, "", &revs->pruning);
|
||||
|
||||
return retval >= 0 && (tree_difference == REV_TREE_SAME);
|
||||
@ -1412,8 +1412,8 @@ void init_revisions(struct rev_info *revs, const char *prefix)
|
||||
revs->abbrev = DEFAULT_ABBREV;
|
||||
revs->ignore_merges = 1;
|
||||
revs->simplify_history = 1;
|
||||
DIFF_OPT_SET(&revs->pruning, RECURSIVE);
|
||||
DIFF_OPT_SET(&revs->pruning, QUICK);
|
||||
revs->pruning.flags.recursive = 1;
|
||||
revs->pruning.flags.quick = 1;
|
||||
revs->pruning.add_remove = file_add_remove;
|
||||
revs->pruning.change = file_change;
|
||||
revs->pruning.change_fn_data = revs;
|
||||
@ -1927,11 +1927,11 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
|
||||
die("--unpacked=<packfile> no longer supported.");
|
||||
} else if (!strcmp(arg, "-r")) {
|
||||
revs->diff = 1;
|
||||
DIFF_OPT_SET(&revs->diffopt, RECURSIVE);
|
||||
revs->diffopt.flags.recursive = 1;
|
||||
} else if (!strcmp(arg, "-t")) {
|
||||
revs->diff = 1;
|
||||
DIFF_OPT_SET(&revs->diffopt, RECURSIVE);
|
||||
DIFF_OPT_SET(&revs->diffopt, TREE_IN_RECURSIVE);
|
||||
revs->diffopt.flags.recursive = 1;
|
||||
revs->diffopt.flags.tree_in_recursive = 1;
|
||||
} else if (!strcmp(arg, "-m")) {
|
||||
revs->ignore_merges = 0;
|
||||
} else if (!strcmp(arg, "-c")) {
|
||||
@ -2076,7 +2076,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
|
||||
revs->grep_filter.pattern_type_option = GREP_PATTERN_TYPE_ERE;
|
||||
} else if (!strcmp(arg, "--regexp-ignore-case") || !strcmp(arg, "-i")) {
|
||||
revs->grep_filter.ignore_case = 1;
|
||||
DIFF_OPT_SET(&revs->diffopt, PICKAXE_IGNORE_CASE);
|
||||
revs->diffopt.flags.pickaxe_ignore_case = 1;
|
||||
} else if (!strcmp(arg, "--fixed-strings") || !strcmp(arg, "-F")) {
|
||||
revs->grep_filter.pattern_type_option = GREP_PATTERN_TYPE_FIXED;
|
||||
} else if (!strcmp(arg, "--perl-regexp") || !strcmp(arg, "-P")) {
|
||||
@ -2409,7 +2409,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
|
||||
/* Pickaxe, diff-filter and rename following need diffs */
|
||||
if (revs->diffopt.pickaxe ||
|
||||
revs->diffopt.filter ||
|
||||
DIFF_OPT_TST(&revs->diffopt, FOLLOW_RENAMES))
|
||||
revs->diffopt.flags.follow_renames)
|
||||
revs->diff = 1;
|
||||
|
||||
if (revs->topo_order)
|
||||
@ -2418,7 +2418,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
|
||||
if (revs->prune_data.nr) {
|
||||
copy_pathspec(&revs->pruning.pathspec, &revs->prune_data);
|
||||
/* Can't prune commits with rename following: the paths change.. */
|
||||
if (!DIFF_OPT_TST(&revs->diffopt, FOLLOW_RENAMES))
|
||||
if (!revs->diffopt.flags.follow_renames)
|
||||
revs->prune = 1;
|
||||
if (!revs->full_diff)
|
||||
copy_pathspec(&revs->diffopt.pathspec,
|
||||
|
||||
Reference in New Issue
Block a user