summaryrefslogtreecommitdiff
path: root/diff.h
diff options
context:
space:
mode:
Diffstat (limited to 'diff.h')
-rw-r--r--diff.h48
1 files changed, 31 insertions, 17 deletions
diff --git a/diff.h b/diff.h
index 8ba85c5..66bd8ae 100644
--- a/diff.h
+++ b/diff.h
@@ -4,10 +4,11 @@
#ifndef DIFF_H
#define DIFF_H
-#include "tree-walk.h"
+#include "hash-ll.h"
#include "pathspec.h"
-#include "object.h"
-#include "oidset.h"
+#include "strbuf.h"
+
+struct oidset;
/**
* The diff API is for programs that compare two sets of files (e.g. two trees,
@@ -71,7 +72,6 @@ struct oid_array;
struct option;
struct repository;
struct rev_info;
-struct strbuf;
struct userdiff_driver;
typedef int (*pathchange_fn_t)(struct diff_options *options,
@@ -283,7 +283,7 @@ struct diff_options {
struct diff_flags flags;
/* diff-filter bits */
- unsigned int filter;
+ unsigned int filter, filter_not;
int use_color;
@@ -333,6 +333,7 @@ struct diff_options {
int prefix_length;
const char *stat_sep;
int xdl_opts;
+ int ignore_driver_algorithm;
/* see Documentation/diff-options.txt */
char **anchors;
@@ -394,7 +395,7 @@ struct diff_options {
unsigned color_moved_ws_handling;
struct repository *repo;
- struct option *parseopts;
+ struct strmap *additional_path_headers;
int no_free;
};
@@ -496,6 +497,8 @@ void diff_tree_combined(const struct object_id *oid, const struct oid_array *par
void diff_tree_combined_merge(const struct commit *commit, struct rev_info *rev);
void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const char *b);
+void diff_set_noprefix(struct diff_options *options);
+void diff_set_default_prefix(struct diff_options *options);
int diff_can_quit_early(struct diff_options *);
@@ -530,16 +533,24 @@ void free_diffstat_info(struct diffstat_t *diffstat);
int parse_long_opt(const char *opt, const char **argv,
const char **optarg);
-int git_diff_basic_config(const char *var, const char *value, void *cb);
+struct config_context;
+int git_diff_basic_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb);
int git_diff_heuristic_config(const char *var, const char *value, void *cb);
void init_diff_ui_defaults(void);
-int git_diff_ui_config(const char *var, const char *value, void *cb);
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define diff_setup(diffopts) repo_diff_setup(the_repository, diffopts)
-#endif
+int git_diff_ui_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb);
void repo_diff_setup(struct repository *, struct diff_options *);
+struct option *add_diff_options(const struct option *, struct diff_options *);
int diff_opt_parse(struct diff_options *, const char **, int, const char *);
void diff_setup_done(struct diff_options *);
+
+/*
+ * Returns true if the pathspec can work with --follow mode. If die_on_error is
+ * set, die() with a specific error message rather than returning false.
+ */
+int diff_check_follow_pathspec(struct pathspec *ps, int die_on_error);
+
int git_config_rename(const char *var, const char *value);
#define DIFF_DETECT_RENAME 1
@@ -562,6 +573,7 @@ int git_config_rename(const char *var, const char *value);
#define DIFF_PICKAXE_IGNORE_CASE 32
+void init_diffstat_widths(struct diff_options *);
void diffcore_std(struct diff_options *);
void diffcore_fix_diff_index(void);
@@ -593,7 +605,7 @@ void diffcore_fix_diff_index(void);
" show all files diff when -S is used and hit is found.\n" \
" -a --text treat all files as text.\n"
-int diff_queue_is_empty(void);
+int diff_queue_is_empty(struct diff_options *o);
void diff_flush(struct diff_options*);
void diff_free(struct diff_options*);
void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc);
@@ -615,7 +627,7 @@ void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc);
#define DIFF_STATUS_FILTER_BROKEN 'B'
/*
- * This is different from find_unique_abbrev() in that
+ * This is different from repo_find_unique_abbrev() in that
* it stuffs the result with dots for alignment.
*/
const char *diff_aligned_abbrev(const struct object_id *sha1, int);
@@ -626,17 +638,17 @@ void diff_get_merge_base(const struct rev_info *revs, struct object_id *mb);
#define DIFF_SILENT_ON_REMOVED 01
/* report racily-clean paths as modified */
#define DIFF_RACY_IS_MODIFIED 02
-int run_diff_files(struct rev_info *revs, unsigned int option);
+void run_diff_files(struct rev_info *revs, unsigned int option);
#define DIFF_INDEX_CACHED 01
#define DIFF_INDEX_MERGE_BASE 02
-int run_diff_index(struct rev_info *revs, unsigned int option);
+void run_diff_index(struct rev_info *revs, unsigned int option);
int do_diff_cache(const struct object_id *, struct diff_options *);
-int diff_flush_patch_id(struct diff_options *, struct object_id *, int, int);
+int diff_flush_patch_id(struct diff_options *, struct object_id *, int);
void flush_one_hunk(struct object_id *result, git_hash_ctx *ctx);
-int diff_result_code(struct diff_options *, int);
+int diff_result_code(struct diff_options *);
int diff_no_index(struct rev_info *,
int implicit_no_index, int, const char **);
@@ -695,4 +707,6 @@ void print_stat_summary(FILE *fp, int files,
int insertions, int deletions);
void setup_diff_pager(struct diff_options *);
+extern int diff_auto_refresh_index;
+
#endif /* DIFF_H */