summaryrefslogtreecommitdiff
path: root/diff.h
diff options
context:
space:
mode:
Diffstat (limited to 'diff.h')
-rw-r--r--diff.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/diff.h b/diff.h
index a24a767..c7ad42a 100644
--- a/diff.h
+++ b/diff.h
@@ -6,6 +6,7 @@
#include "tree-walk.h"
#include "pathspec.h"
+#include "object.h"
struct rev_info;
struct diff_options;
@@ -15,6 +16,10 @@ struct diff_filespec;
struct userdiff_driver;
struct sha1_array;
struct commit;
+struct combine_diff_path;
+
+typedef int (*pathchange_fn_t)(struct diff_options *options,
+ struct combine_diff_path *path);
typedef void (*change_fn_t)(struct diff_options *options,
unsigned old_mode, unsigned new_mode,
@@ -133,6 +138,11 @@ struct diff_options {
int dirstat_permille;
int setup;
int abbrev;
+/* white-space error highlighting */
+#define WSEH_NEW 1
+#define WSEH_CONTEXT 2
+#define WSEH_OLD 4
+ unsigned ws_error_highlight;
const char *prefix;
int prefix_length;
const char *stat_sep;
@@ -157,6 +167,7 @@ struct diff_options {
int close_file;
struct pathspec pathspec;
+ pathchange_fn_t pathchange;
change_fn_t change;
add_remove_fn_t add_remove;
diff_format_fn_t format_callback;
@@ -170,7 +181,7 @@ struct diff_options {
enum color_diff {
DIFF_RESET = 0,
- DIFF_PLAIN = 1,
+ DIFF_CONTEXT = 1,
DIFF_METAINFO = 2,
DIFF_FRAGINFO = 3,
DIFF_FILE_OLD = 4,
@@ -189,8 +200,10 @@ const char *diff_line_prefix(struct diff_options *);
extern const char mime_boundary_leader[];
-extern int diff_tree(struct tree_desc *t1, struct tree_desc *t2,
- const char *base, struct diff_options *opt);
+extern struct combine_diff_path *diff_tree_paths(
+ struct combine_diff_path *p, const unsigned char *sha1,
+ const unsigned char **parent_sha1, int nparent,
+ struct strbuf *base, struct diff_options *opt);
extern int diff_tree_sha1(const unsigned char *old, const unsigned char *new,
const char *base, struct diff_options *opt);
extern int diff_root_tree_sha1(const unsigned char *new, const char *base,
@@ -200,11 +213,11 @@ struct combine_diff_path {
struct combine_diff_path *next;
char *path;
unsigned int mode;
- unsigned char sha1[20];
+ struct object_id oid;
struct combine_diff_parent {
char status;
unsigned int mode;
- unsigned char sha1[20];
+ struct object_id oid;
} parent[FLEX_ARRAY];
};
#define combine_diff_path_size(n, l) \