Code

Merge branch 'ph/diffopts'
authorJunio C Hamano <gitster@pobox.com>
Sun, 18 Nov 2007 23:50:16 +0000 (15:50 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 18 Nov 2007 23:50:16 +0000 (15:50 -0800)
* ph/diffopts:
  Reorder diff_opt_parse options more logically per topics.
  Make the diff_options bitfields be an unsigned with explicit masks.
  Use OPT_BIT in builtin-pack-refs
  Use OPT_BIT in builtin-for-each-ref
  Use OPT_SET_INT and OPT_BIT in builtin-branch
  parse-options new features.

1  2 
builtin-for-each-ref.c
builtin-log.c
diff-lib.c
diff.h
git-compat-util.h

Simple merge
diff --cc builtin-log.c
Simple merge
diff --cc diff-lib.c
index ec1b5e3d446c4e5a56fb5f3e4420499c4e8918eb,290a170b053c87b281570eccfa9f4e4b3fed1794..f8e936ae1008fdb7ef8e1722afb839d84c724f6c
@@@ -189,11 -188,11 +189,11 @@@ static int handle_diff_files_args(struc
                else if (!strcmp(argv[1], "-n") ||
                                !strcmp(argv[1], "--no-index")) {
                        revs->max_count = -2;
-                       revs->diffopt.exit_with_status = 1;
-                       revs->diffopt.no_index = 1;
+                       DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS);
+                       DIFF_OPT_SET(&revs->diffopt, NO_INDEX);
                }
                else if (!strcmp(argv[1], "-q"))
 -                      *silent = 1;
 +                      *options |= DIFF_SILENT_ON_REMOVED;
                else
                        return error("invalid option: %s", argv[1]);
                argv++; argc--;
@@@ -306,12 -305,12 +306,12 @@@ int setup_diff_no_index(struct rev_inf
  
  int run_diff_files_cmd(struct rev_info *revs, int argc, const char **argv)
  {
 -      int silent_on_removed;
 +      unsigned int options;
  
 -      if (handle_diff_files_args(revs, argc, argv, &silent_on_removed))
 +      if (handle_diff_files_args(revs, argc, argv, &options))
                return -1;
  
-       if (revs->diffopt.no_index) {
+       if (DIFF_OPT_TST(&revs->diffopt, NO_INDEX)) {
                if (revs->diffopt.nr_paths != 2)
                        return error("need two files/directories with --no-index");
                if (queue_diff(&revs->diffopt, revs->diffopt.paths[0],
@@@ -445,8 -442,8 +446,8 @@@ int run_diff_files(struct rev_info *rev
                                       ce->sha1, ce->name, NULL);
                        continue;
                }
 -              changed = ce_match_stat(ce, &st, 0);
 +              changed = ce_match_stat(ce, &st, ce_option);
-               if (!changed && !revs->diffopt.find_copies_harder)
+               if (!changed && !DIFF_OPT_TST(&revs->diffopt, FIND_COPIES_HARDER))
                        continue;
                oldmode = ntohl(ce->ce_mode);
                newmode = ntohl(ce_mode_from_stat(ce, st.st_mode));
diff --cc diff.h
Simple merge
Simple merge