aboutsummaryrefslogtreecommitdiff
path: root/diff.h
diff options
context:
space:
mode:
Diffstat (limited to 'diff.h')
-rw-r--r--diff.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/diff.h b/diff.h
index a36720752..a24a767db 100644
--- a/diff.h
+++ b/diff.h
@@ -5,6 +5,7 @@
#define DIFF_H
#include "tree-walk.h"
+#include "pathspec.h"
struct rev_info;
struct diff_options;
@@ -87,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)
@@ -108,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;
@@ -148,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;
@@ -159,6 +164,8 @@ struct diff_options {
diff_prefix_fn_t output_prefix;
int output_prefix_length;
void *output_prefix_data;
+
+ int diff_path_counter;
};
enum color_diff {
@@ -182,8 +189,6 @@ const char *diff_line_prefix(struct diff_options *);
extern const char mime_boundary_leader[];
-extern void diff_tree_setup_paths(const char **paths, struct diff_options *);
-extern void diff_tree_release_paths(struct diff_options *);
extern int diff_tree(struct tree_desc *t1, struct tree_desc *t2,
const char *base, struct diff_options *opt);
extern int diff_tree_sha1(const unsigned char *old, const unsigned char *new,
@@ -193,7 +198,6 @@ extern int diff_root_tree_sha1(const unsigned char *new, const char *base,
struct combine_diff_path {
struct combine_diff_path *next;
- int len;
char *path;
unsigned int mode;
unsigned char sha1[20];
@@ -241,7 +245,7 @@ extern struct diff_filepair *diff_unmerge(struct diff_options *, const char *pat
#define DIFF_SETUP_USE_SIZE_CACHE 4
/*
- * Poor man's alternative to parse-option, to allow both sticked form
+ * Poor man's alternative to parse-option, to allow both stuck form
* (--option=value) and separate form (--option value).
*/
extern int parse_long_opt(const char *opt, const char **argv,
@@ -327,7 +331,7 @@ extern int diff_flush_patch_id(struct diff_options *, unsigned char *);
extern int diff_result_code(struct diff_options *, int);
-extern void diff_no_index(struct rev_info *, int, const char **, int, const char *);
+extern void diff_no_index(struct rev_info *, int, const char **, const char *);
extern int index_differs_from(const char *def, int diff_flags);