Merge branch 'bw/diff-opt-impl-to-bitfields'
authorJunio C Hamano <gitster@pobox.com>
Thu, 9 Nov 2017 05:31:27 +0000 (14:31 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Nov 2017 05:31:27 +0000 (14:31 +0900)
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

20 files changed:
1  2 
blame.c
builtin/am.c
builtin/commit.c
builtin/diff.c
builtin/fast-export.c
builtin/log.c
builtin/merge-ours.c
builtin/reset.c
builtin/rev-list.c
combine-diff.c
diff-lib.c
diff.c
diff.h
log-tree.c
merge-recursive.c
notes-merge.c
revision.c
sequencer.c
submodule.c
wt-status.c
diff --cc blame.c
Simple merge
diff --cc builtin/am.c
Simple merge
Simple merge
diff --cc builtin/diff.c
Simple merge
Simple merge
diff --cc builtin/log.c
Simple merge
index beb0623d56323a0ea8912e54e94e66fa07268156,684411694f64ca216fb03430df2d2a0ec9ea93ff..c84c6e05e922f09692b9b133cd391b850c7951df
@@@ -20,13 -24,11 +20,13 @@@ int cmd_merge_ours(int argc, const cha
                usage(builtin_merge_ours_usage);
  
        /*
 -       * We need to exit with 2 if the index does not match our HEAD tree,
 -       * because the current index is what we will be committing as the
 -       * merge result.
 +       * The contents of the current index becomes the tree we
 +       * commit.  The index must match HEAD, or this merge cannot go
 +       * through.
         */
 -      if (cmd_diff_index(NARGS, diff_index_args, prefix))
 +      if (read_cache() < 0)
 +              die_errno("read_cache failed");
-       if (index_differs_from("HEAD", 0, 0))
++      if (index_differs_from("HEAD", NULL, 0))
                exit(2);
        exit(0);
  }
diff --cc builtin/reset.c
Simple merge
Simple merge
diff --cc combine-diff.c
Simple merge
diff --cc diff-lib.c
Simple merge
diff --cc diff.c
Simple merge
diff --cc diff.h
Simple merge
diff --cc log-tree.c
Simple merge
Simple merge
diff --cc notes-merge.c
Simple merge
diff --cc revision.c
index 99c95c19b0093094878bdae02a22944fd2aeff37,bfde5b0cd5ce46b319dd1a0c0476a2297eb0e4a5..e2e691dd5a48087da0b476cf4d6cded645f23d6e
@@@ -415,11 -407,10 +415,11 @@@ static void file_add_remove(struct diff
                    const char *fullpath, unsigned dirty_submodule)
  {
        int diff = addremove == '+' ? REV_TREE_NEW : REV_TREE_OLD;
 +      struct rev_info *revs = options->change_fn_data;
  
        tree_difference |= diff;
 -      if (tree_difference == REV_TREE_DIFFERENT)
 +      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,
@@@ -1412,11 -1403,10 +1412,11 @@@ void init_revisions(struct rev_info *re
        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;
        revs->sort_order = REV_SORT_IN_GRAPH_ORDER;
        revs->dense = 1;
        revs->prefix = prefix;
diff --cc sequencer.c
Simple merge
diff --cc submodule.c
Simple merge
diff --cc wt-status.c
Simple merge