summaryrefslogtreecommitdiff
path: root/diff.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-10-23 20:21:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-10-23 20:21:31 (GMT)
commit4197361e39a304df30cc492122dbdfe90ae8af0e (patch)
treee64abbced7f07dab484262d7c0dab12af1abe2d0 /diff.h
parenteeb8e8373f68b706f5fc8a00760c3dedf239db70 (diff)
parentafa15f3cd8f4cbf9572138329be374ff8566b10a (diff)
downloadgit-4197361e39a304df30cc492122dbdfe90ae8af0e.zip
git-4197361e39a304df30cc492122dbdfe90ae8af0e.tar.gz
git-4197361e39a304df30cc492122dbdfe90ae8af0e.tar.bz2
Merge branch 'mg/more-textconv'
Make "git grep" and "git show" pay attention to --textconv when dealing with blob objects. * mg/more-textconv: grep: honor --textconv for the case rev:path grep: allow to use textconv filters t7008: demonstrate behavior of grep with textconv cat-file: do not die on --textconv without textconv filters show: honor --textconv for blobs diff_opt: track whether flags have been set explicitly t4030: demonstrate behavior of show with textconv
Diffstat (limited to 'diff.h')
-rw-r--r--diff.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/diff.h b/diff.h
index 44092c2..e342325 100644
--- a/diff.h
+++ b/diff.h
@@ -88,8 +88,9 @@ typedef struct strbuf *(*diff_prefix_fn_t)(struct diff_options *opt, void *data)
#define DIFF_OPT_PICKAXE_IGNORE_CASE (1 << 30)
#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)
+#define DIFF_OPT_TOUCHED(opts, flag) ((opts)->touched_flags & DIFF_OPT_##flag)
+#define DIFF_OPT_SET(opts, flag) (((opts)->flags |= DIFF_OPT_##flag),((opts)->touched_flags |= DIFF_OPT_##flag))
+#define DIFF_OPT_CLR(opts, flag) (((opts)->flags &= ~DIFF_OPT_##flag),((opts)->touched_flags |= DIFF_OPT_##flag))
#define DIFF_XDL_TST(opts, flag) ((opts)->xdl_opts & XDF_##flag)
#define DIFF_XDL_SET(opts, flag) ((opts)->xdl_opts |= XDF_##flag)
#define DIFF_XDL_CLR(opts, flag) ((opts)->xdl_opts &= ~XDF_##flag)
@@ -109,6 +110,7 @@ struct diff_options {
const char *single_follow;
const char *a_prefix, *b_prefix;
unsigned flags;
+ unsigned touched_flags;
/* diff-filter bits */
unsigned int filter;
@@ -149,6 +151,8 @@ struct diff_options {
/* to support internal diff recursion by --follow hack*/
int found_follow;
+ void (*set_default)(struct diff_options *);
+
FILE *file;
int close_file;