X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=diff.h;h=12590791cbefe8717891365b6d417f60c51f684f;hb=4f9dcf7e5cf6c82455925102d315daf3b833e6d6;hp=7f4079c87104afd8bda23046942121b7d3ff62ee;hpb=c1067050ce58b5b39f528fe634732da858664603;p=git.git diff --git a/diff.h b/diff.h index 7f4079c8..12590791 100644 --- a/diff.h +++ b/diff.h @@ -8,11 +8,31 @@ (S_ISREG(mode) ? (S_IFREG | ce_permissions(mode)) : \ S_ISLNK(mode) ? S_IFLNK : S_IFDIR) +struct tree_desc { + void *buf; + unsigned long size; +}; + +struct diff_options; + +typedef void (*change_fn_t)(struct diff_options *options, + unsigned old_mode, unsigned new_mode, + const unsigned char *old_sha1, + const unsigned char *new_sha1, + const char *base, const char *path); + +typedef void (*add_remove_fn_t)(struct diff_options *options, + int addremove, unsigned mode, + const unsigned char *sha1, + const char *base, const char *path); + struct diff_options { const char **paths; const char *filter; const char *orderfile; const char *pickaxe; + unsigned recursive:1, + tree_in_recursive:1; int break_opt; int detect_rename; int find_copies_harder; @@ -23,8 +43,17 @@ struct diff_options { int reverse_diff; int rename_limit; int setup; + + change_fn_t change; + add_remove_fn_t add_remove; }; +extern void diff_tree_setup_paths(const char **paths); +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, + const char *base, struct diff_options *opt); + extern void diff_addremove(struct diff_options *, int addremove, unsigned mode, @@ -62,7 +91,6 @@ extern void diffcore_std_no_resolve(struct diff_options *); #define COMMON_DIFF_OPTIONS_HELP \ "\ncommon diff options:\n" \ -" -r diff recursively (only meaningful in diff-tree)\n" \ " -z output diff-raw with lines terminated with NUL.\n" \ " -p output patch format.\n" \ " -u synonym for -p.\n" \ @@ -103,7 +131,7 @@ extern void diff_flush(struct diff_options*); /* these are not diff-raw status letters proper, but used by * diffcore-filter insn to specify additional restrictions. */ -#define DIFF_STATUS_FILTER_AON 'A' +#define DIFF_STATUS_FILTER_AON '*' #define DIFF_STATUS_FILTER_BROKEN 'B' #endif /* DIFF_H */