summaryrefslogtreecommitdiff
path: root/diff.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-18 15:50:16 -0800
committerJunio C Hamano <gitster@pobox.com>2007-11-18 15:50:16 -0800
commite6cb314c087661a535b8873502b6d40cef1bbd57 (patch)
treeb097ca74690e1d6bf8a95b5162eb95ec931ad5ed /diff.h
parent41d8a5f0f7db6e1d92f925234eb8c55d2d34a5af (diff)
parentd054680c7d245b71ebba0dd030fd13dce213559a (diff)
downloadgit-e6cb314c087661a535b8873502b6d40cef1bbd57.tar.gz
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.
Diffstat (limited to 'diff.h')
-rw-r--r--diff.h40
1 files changed, 24 insertions, 16 deletions
diff --git a/diff.h b/diff.h
index efaa8f711a..a52496a108 100644
--- a/diff.h
+++ b/diff.h
@@ -43,26 +43,32 @@ typedef void (*diff_format_fn_t)(struct diff_queue_struct *q,
#define DIFF_FORMAT_CALLBACK 0x1000
+#define DIFF_OPT_RECURSIVE (1 << 0)
+#define DIFF_OPT_TREE_IN_RECURSIVE (1 << 1)
+#define DIFF_OPT_BINARY (1 << 2)
+#define DIFF_OPT_TEXT (1 << 3)
+#define DIFF_OPT_FULL_INDEX (1 << 4)
+#define DIFF_OPT_SILENT_ON_REMOVE (1 << 5)
+#define DIFF_OPT_FIND_COPIES_HARDER (1 << 6)
+#define DIFF_OPT_FOLLOW_RENAMES (1 << 7)
+#define DIFF_OPT_COLOR_DIFF (1 << 8)
+#define DIFF_OPT_COLOR_DIFF_WORDS (1 << 9)
+#define DIFF_OPT_HAS_CHANGES (1 << 10)
+#define DIFF_OPT_QUIET (1 << 11)
+#define DIFF_OPT_NO_INDEX (1 << 12)
+#define DIFF_OPT_ALLOW_EXTERNAL (1 << 13)
+#define DIFF_OPT_EXIT_WITH_STATUS (1 << 14)
+#define DIFF_OPT_REVERSE_DIFF (1 << 15)
+#define DIFF_OPT_TST(opts, flag) ((opts)->flags & DIFF_OPT_##flag)
+#define DIFF_OPT_SET(opts, flag) ((opts)->flags |= DIFF_OPT_##flag)
+#define DIFF_OPT_CLR(opts, flag) ((opts)->flags &= ~DIFF_OPT_##flag)
+
struct diff_options {
const char *filter;
const char *orderfile;
const char *pickaxe;
const char *single_follow;
- unsigned recursive:1,
- tree_in_recursive:1,
- binary:1,
- text:1,
- full_index:1,
- silent_on_remove:1,
- find_copies_harder:1,
- follow_renames:1,
- color_diff:1,
- color_diff_words:1,
- has_changes:1,
- quiet:1,
- no_index:1,
- allow_external:1,
- exit_with_status:1;
+ unsigned flags;
int context;
int break_opt;
int detect_rename;
@@ -71,7 +77,6 @@ struct diff_options {
int output_format;
int pickaxe_opts;
int rename_score;
- int reverse_diff;
int rename_limit;
int setup;
int abbrev;
@@ -105,6 +110,9 @@ enum color_diff {
DIFF_WHITESPACE = 7,
};
const char *diff_get_color(int diff_use_color, enum color_diff ix);
+#define diff_get_color_opt(o, ix) \
+ diff_get_color(DIFF_OPT_TST((o), COLOR_DIFF), ix)
+
extern const char mime_boundary_leader[];