author | Junio C Hamano <gitster@pobox.com> | |
Sun, 18 Nov 2007 23:50:16 +0000 (15:50 -0800) | ||
committer | Junio 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.
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 | patch | | diff1 | | diff2 | | blob | history |
builtin-log.c | patch | | diff1 | | diff2 | | blob | history |
diff-lib.c | patch | | diff1 | | diff2 | | blob | history |
diff.h | patch | | diff1 | | diff2 | | blob | history |
git-compat-util.h | patch | | diff1 | | diff2 | | blob | history |
diff --cc builtin-for-each-ref.c
Simple merge
diff --cc builtin-log.c
Simple merge
diff --cc diff-lib.c
index ec1b5e3d446c4e5a56fb5f3e4420499c4e8918eb,290a170b053c87b281570eccfa9f4e4b3fed1794..f8e936ae1008fdb7ef8e1722afb839d84c724f6c
--- 1/diff-lib.c
--- 2/diff-lib.c
+++ b/diff-lib.c
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--;
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],
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
diff --cc git-compat-util.h
Simple merge