From: Junio C Hamano Date: Sun, 18 Nov 2007 23:50:16 +0000 (-0800) Subject: Merge branch 'ph/diffopts' X-Git-Tag: v1.5.4-rc0~186 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e6cb314c087661a535b8873502b6d40cef1bbd57;p=git.git Merge branch 'ph/diffopts' * 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. --- e6cb314c087661a535b8873502b6d40cef1bbd57 diff --cc diff-lib.c index ec1b5e3d4,290a170b0..f8e936ae1 --- a/diff-lib.c +++ b/diff-lib.c @@@ -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));