🌐 AI搜索 & 代理 主页
blob: ce123fa06fee6fb6e5e76d6a92ea8284a5bbbcf1 [file] [log] [blame]
Junio C Hamanobe3cfa82005-04-26 16:25:051/*
2 * Copyright (C) 2005 Junio C Hamano
3 */
Junio C Hamano86436c22005-04-26 01:22:474#ifndef DIFF_H
5#define DIFF_H
6
Junio C Hamano1b0c7172006-03-30 06:55:437#include "tree-walk.h"
Nguyễn Thái Ngọc Duy64acde92013-07-14 08:35:258#include "pathspec.h"
Linus Torvalds50f9a852006-01-31 22:10:569
Linus Torvalds91539832006-04-17 18:59:3210struct rev_info;
Linus Torvaldsac1b3d12005-10-21 04:05:0511struct diff_options;
Jeff King04245582006-09-07 06:35:4212struct diff_queue_struct;
Bo Yanga3c158d2010-05-26 07:08:0213struct strbuf;
Axel Bonneta788d7d2010-06-07 15:23:3614struct diff_filespec;
15struct userdiff_driver;
René Scharfe0041f092011-12-17 10:15:4816struct sha1_array;
René Scharfe82889292011-12-17 10:20:0717struct commit;
Linus Torvaldsac1b3d12005-10-21 04:05:0518
19typedef void (*change_fn_t)(struct diff_options *options,
20 unsigned old_mode, unsigned new_mode,
21 const unsigned char *old_sha1,
22 const unsigned char *new_sha1,
Jeff Kinge5450102012-07-28 15:03:0123 int old_sha1_valid, int new_sha1_valid,
Jens Lehmanne3d42c42010-01-18 20:26:1824 const char *fullpath,
25 unsigned old_dirty_submodule, unsigned new_dirty_submodule);
Linus Torvaldsac1b3d12005-10-21 04:05:0526
27typedef void (*add_remove_fn_t)(struct diff_options *options,
28 int addremove, unsigned mode,
29 const unsigned char *sha1,
Jeff Kinge5450102012-07-28 15:03:0130 int sha1_valid,
Jens Lehmanne3d42c42010-01-18 20:26:1831 const char *fullpath, unsigned dirty_submodule);
Linus Torvaldsac1b3d12005-10-21 04:05:0532
Jeff King04245582006-09-07 06:35:4233typedef void (*diff_format_fn_t)(struct diff_queue_struct *q,
34 struct diff_options *options, void *data);
35
Bo Yanga3c158d2010-05-26 07:08:0236typedef struct strbuf *(*diff_prefix_fn_t)(struct diff_options *opt, void *data);
37
Timo Hirvonenc6744342006-06-24 17:21:5338#define DIFF_FORMAT_RAW 0x0001
39#define DIFF_FORMAT_DIFFSTAT 0x0002
Junio C Hamano74e2abe2006-10-12 10:01:0040#define DIFF_FORMAT_NUMSTAT 0x0004
41#define DIFF_FORMAT_SUMMARY 0x0008
42#define DIFF_FORMAT_PATCH 0x0010
Nicolas Pitreebd124c2006-12-15 04:15:4443#define DIFF_FORMAT_SHORTSTAT 0x0020
Linus Torvalds7df7c012008-02-12 21:26:3144#define DIFF_FORMAT_DIRSTAT 0x0040
Timo Hirvonenc6744342006-06-24 17:21:5345
46/* These override all above */
Junio C Hamano74e2abe2006-10-12 10:01:0047#define DIFF_FORMAT_NAME 0x0100
48#define DIFF_FORMAT_NAME_STATUS 0x0200
49#define DIFF_FORMAT_CHECKDIFF 0x0400
Timo Hirvonenc6744342006-06-24 17:21:5350
51/* Same as output_format = 0 but we know that -s flag was given
52 * and we should not give default value to output_format.
53 */
Junio C Hamano74e2abe2006-10-12 10:01:0054#define DIFF_FORMAT_NO_OUTPUT 0x0800
Timo Hirvonenc6744342006-06-24 17:21:5355
Junio C Hamano74e2abe2006-10-12 10:01:0056#define DIFF_FORMAT_CALLBACK 0x1000
Jeff King04245582006-09-07 06:35:4257
Pierre Habouzit8f67f8a2007-11-10 19:05:1458#define DIFF_OPT_RECURSIVE (1 << 0)
59#define DIFF_OPT_TREE_IN_RECURSIVE (1 << 1)
60#define DIFF_OPT_BINARY (1 << 2)
61#define DIFF_OPT_TEXT (1 << 3)
62#define DIFF_OPT_FULL_INDEX (1 << 4)
63#define DIFF_OPT_SILENT_ON_REMOVE (1 << 5)
64#define DIFF_OPT_FIND_COPIES_HARDER (1 << 6)
65#define DIFF_OPT_FOLLOW_RENAMES (1 << 7)
Jeff King90d43b02012-03-22 22:52:1366#define DIFF_OPT_RENAME_EMPTY (1 << 8)
Thomas Rast882749a2010-04-14 15:59:0667/* (1 << 9) unused */
Pierre Habouzit8f67f8a2007-11-10 19:05:1468#define DIFF_OPT_HAS_CHANGES (1 << 10)
Junio C Hamano90b19942009-05-23 08:15:3569#define DIFF_OPT_QUICK (1 << 11)
Pierre Habouzit8f67f8a2007-11-10 19:05:1470#define DIFF_OPT_NO_INDEX (1 << 12)
71#define DIFF_OPT_ALLOW_EXTERNAL (1 << 13)
72#define DIFF_OPT_EXIT_WITH_STATUS (1 << 14)
73#define DIFF_OPT_REVERSE_DIFF (1 << 15)
Wincent Colaiuta62c64892007-12-13 20:24:5274#define DIFF_OPT_CHECK_FAILED (1 << 16)
Junio C Hamanocd676a52008-02-12 22:26:0275#define DIFF_OPT_RELATIVE_NAME (1 << 17)
Johannes Schindelin50fd9bd2008-05-14 17:03:3176#define DIFF_OPT_IGNORE_SUBMODULES (1 << 18)
Junio C Hamanof88d2252008-09-03 00:28:5977#define DIFF_OPT_DIRSTAT_CUMULATIVE (1 << 19)
Heikki Orsilafd337772008-09-05 19:27:3578#define DIFF_OPT_DIRSTAT_BY_FILE (1 << 20)
Jeff Kingc7534ef2008-10-26 04:45:5579#define DIFF_OPT_ALLOW_TEXTCONV (1 << 21)
Junio C Hamanof2451942009-05-22 19:45:2980#define DIFF_OPT_DIFF_FROM_CONTENTS (1 << 22)
Johannes Schindelin752c0c22009-10-19 12:38:3281#define DIFF_OPT_SUBMODULE_LOG (1 << 23)
Jens Lehmann9297f77e62010-03-08 12:53:1982#define DIFF_OPT_DIRTY_SUBMODULES (1 << 24)
Jens Lehmann3bfc4502010-03-13 22:00:2783#define DIFF_OPT_IGNORE_UNTRACKED_IN_SUBMODULES (1 << 25)
Junio C Hamano4af574d2010-06-27 19:07:4484#define DIFF_OPT_IGNORE_DIRTY_SUBMODULES (1 << 26)
Jens Lehmannaee9c7d2010-08-05 22:39:2585#define DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG (1 << 27)
Johan Herland1c57a622011-04-29 09:36:2186#define DIFF_OPT_DIRSTAT_BY_LINE (1 << 28)
René Scharfe14937c22011-10-09 11:36:5787#define DIFF_OPT_FUNCCONTEXT (1 << 29)
Junio C Hamanoaccccde2012-02-21 09:02:4688#define DIFF_OPT_PICKAXE_IGNORE_CASE (1 << 30)
Johannes Schindelin752c0c22009-10-19 12:38:3289
Pierre Habouzit8f67f8a2007-11-10 19:05:1490#define DIFF_OPT_TST(opts, flag) ((opts)->flags & DIFF_OPT_##flag)
Junio C Hamano6c374002013-05-10 15:10:1191#define DIFF_OPT_TOUCHED(opts, flag) ((opts)->touched_flags & DIFF_OPT_##flag)
92#define DIFF_OPT_SET(opts, flag) (((opts)->flags |= DIFF_OPT_##flag),((opts)->touched_flags |= DIFF_OPT_##flag))
93#define DIFF_OPT_CLR(opts, flag) (((opts)->flags &= ~DIFF_OPT_##flag),((opts)->touched_flags |= DIFF_OPT_##flag))
Keith Cascio628d5c22009-02-17 03:26:4994#define DIFF_XDL_TST(opts, flag) ((opts)->xdl_opts & XDF_##flag)
95#define DIFF_XDL_SET(opts, flag) ((opts)->xdl_opts |= XDF_##flag)
96#define DIFF_XDL_CLR(opts, flag) ((opts)->xdl_opts &= ~XDF_##flag)
Pierre Habouzit8f67f8a2007-11-10 19:05:1497
Junio C Hamano307ab202012-02-19 23:36:5598#define DIFF_WITH_ALG(opts, flag) (((opts)->xdl_opts & ~XDF_DIFF_ALGORITHM_MASK) | XDF_##flag)
99
Thomas Rast882749a2010-04-14 15:59:06100enum diff_words_type {
101 DIFF_WORDS_NONE = 0,
102 DIFF_WORDS_PORCELAIN,
103 DIFF_WORDS_PLAIN,
104 DIFF_WORDS_COLOR
105};
106
Junio C Hamano6b5ee132005-09-21 07:00:47107struct diff_options {
Junio C Hamano6b5ee132005-09-21 07:00:47108 const char *orderfile;
109 const char *pickaxe;
Junio C Hamano2f3f8b22006-11-02 08:02:11110 const char *single_follow;
Johannes Schindelineab9a402007-12-18 19:32:14111 const char *a_prefix, *b_prefix;
Pierre Habouzit8f67f8a2007-11-10 19:05:14112 unsigned flags;
Junio C Hamano6c374002013-05-10 15:10:11113 unsigned touched_flags;
Junio C Hamano1ecc1cb2013-07-17 22:05:46114
115 /* diff-filter bits */
116 unsigned int filter;
117
Jeff Kingf1c96262011-08-18 05:03:12118 int use_color;
Linus Torvaldsee1e5412006-05-13 20:23:48119 int context;
René Scharfe6d0e6742008-12-28 18:45:32120 int interhunkcontext;
Junio C Hamano6b5ee132005-09-21 07:00:47121 int break_opt;
122 int detect_rename;
Junio C Hamano467ddc12011-03-01 00:11:55123 int irreversible_delete;
Junio C Hamanofb132272007-08-03 20:33:31124 int skip_stat_unmatch;
Junio C Hamano6b5ee132005-09-21 07:00:47125 int line_termination;
126 int output_format;
127 int pickaxe_opts;
128 int rename_score;
Junio C Hamano8082d8d2005-09-21 07:18:27129 int rename_limit;
Jeff Kingbf0ab102011-02-19 10:20:51130 int needed_rename_limit;
Junio C Hamanof31027c2011-01-06 21:50:06131 int degraded_cc_to_c;
Jeff King3ac942d2011-02-20 09:51:16132 int show_rename_progress;
Johan Herland712d2c72011-04-29 09:36:20133 int dirstat_permille;
Junio C Hamano6b5ee132005-09-21 07:00:47134 int setup;
Junio C Hamano47dd0d52005-12-14 01:21:41135 int abbrev;
Junio C Hamanocd676a52008-02-12 22:26:02136 const char *prefix;
137 int prefix_length;
Johannes Schindelin698ce6f2006-05-20 13:40:29138 const char *stat_sep;
Johannes Schindelin0d21efa2006-06-14 15:40:23139 long xdl_opts;
Linus Torvaldsac1b3d12005-10-21 04:05:05140
Junio C Hamanoa2540022006-09-27 01:53:02141 int stat_width;
142 int stat_name_width;
Zbigniew Jędrzejewski-Szmek969fe572012-03-01 12:26:45143 int stat_graph_width;
Michael J Gruber808e1db2011-05-27 12:36:41144 int stat_count;
Johannes Schindelin2b6a5412009-01-17 16:29:45145 const char *word_regex;
Thomas Rast882749a2010-04-14 15:59:06146 enum diff_words_type word_diff;
Junio C Hamanoa2540022006-09-27 01:53:02147
Johannes Schindelin34a5e1a2007-02-25 22:34:54148 /* this is set by diffcore for DIFF_FORMAT_PATCH */
149 int found_changes;
150
Junio C Hamano44c48a92010-08-13 19:17:45151 /* to support internal diff recursion by --follow hack*/
152 int found_follow;
153
Junio C Hamano6c374002013-05-10 15:10:11154 void (*set_default)(struct diff_options *);
155
Daniel Barkalowc0c77732008-03-10 02:43:39156 FILE *file;
157 int close_file;
158
Nguyễn Thái Ngọc Duy66f13622010-12-15 15:02:38159 struct pathspec pathspec;
Linus Torvaldsac1b3d12005-10-21 04:05:05160 change_fn_t change;
161 add_remove_fn_t add_remove;
Jeff King04245582006-09-07 06:35:42162 diff_format_fn_t format_callback;
163 void *format_callback_data;
Bo Yanga3c158d2010-05-26 07:08:02164 diff_prefix_fn_t output_prefix;
Lucian Poston5e71a842012-04-16 10:44:50165 int output_prefix_length;
Bo Yanga3c158d2010-05-26 07:08:02166 void *output_prefix_data;
Zoltan Klingeree7fb0b2013-12-05 23:38:46167
168 int diff_path_counter;
Junio C Hamano6b5ee132005-09-21 07:00:47169};
170
Jeff Kingce436972006-07-23 09:24:18171enum color_diff {
172 DIFF_RESET = 0,
173 DIFF_PLAIN = 1,
174 DIFF_METAINFO = 2,
175 DIFF_FRAGINFO = 3,
176 DIFF_FILE_OLD = 4,
177 DIFF_FILE_NEW = 5,
178 DIFF_COMMIT = 6,
Junio C Hamano448c3ef2006-09-23 05:48:39179 DIFF_WHITESPACE = 7,
Gary V. Vaughan4b055482010-05-14 09:31:35180 DIFF_FUNCINFO = 8
Jeff Kingce436972006-07-23 09:24:18181};
182const char *diff_get_color(int diff_use_color, enum color_diff ix);
Pierre Habouzit8f67f8a2007-11-10 19:05:14183#define diff_get_color_opt(o, ix) \
Jeff Kingf1c96262011-08-18 05:03:12184 diff_get_color((o)->use_color, ix)
Pierre Habouzit8f67f8a2007-11-10 19:05:14185
Jeff Kingce436972006-07-23 09:24:18186
John Keepingf1922232013-02-07 20:15:26187const char *diff_line_prefix(struct diff_options *);
188
189
Johannes Schindelin698ce6f2006-05-20 13:40:29190extern const char mime_boundary_leader[];
191
Linus Torvaldsac1b3d12005-10-21 04:05:05192extern int diff_tree(struct tree_desc *t1, struct tree_desc *t2,
193 const char *base, struct diff_options *opt);
194extern int diff_tree_sha1(const unsigned char *old, const unsigned char *new,
195 const char *base, struct diff_options *opt);
Rene Scharfe2b603562006-10-26 16:52:39196extern int diff_root_tree_sha1(const unsigned char *new, const char *base,
197 struct diff_options *opt);
Linus Torvaldsac1b3d12005-10-21 04:05:05198
Junio C Hamanoea726d02006-01-28 08:03:38199struct combine_diff_path {
200 struct combine_diff_path *next;
201 int len;
202 char *path;
Junio C Hamano2454c962006-02-06 20:53:07203 unsigned int mode;
Junio C Hamanoea726d02006-01-28 08:03:38204 unsigned char sha1[20];
Junio C Hamano2454c962006-02-06 20:53:07205 struct combine_diff_parent {
Junio C Hamanod416df82006-02-10 10:30:52206 char status;
Junio C Hamano2454c962006-02-06 20:53:07207 unsigned int mode;
208 unsigned char sha1[20];
209 } parent[FLEX_ARRAY];
Junio C Hamanoea726d02006-01-28 08:03:38210};
Junio C Hamano2454c962006-02-06 20:53:07211#define combine_diff_path_size(n, l) \
212 (sizeof(struct combine_diff_path) + \
213 sizeof(struct combine_diff_parent) * (n) + (l) + 1)
Junio C Hamanoea726d02006-01-28 08:03:38214
Linus Torvalds91539832006-04-17 18:59:32215extern void show_combined_diff(struct combine_diff_path *elem, int num_parent,
216 int dense, struct rev_info *);
Junio C Hamanoea726d02006-01-28 08:03:38217
René Scharfe0041f092011-12-17 10:15:48218extern void diff_tree_combined(const unsigned char *sha1, const struct sha1_array *parents, int dense, struct rev_info *rev);
Junio C Hamano0fe7c1d2006-04-29 08:24:49219
René Scharfe82889292011-12-17 10:20:07220extern void diff_tree_combined_merge(const struct commit *commit, int dense, struct rev_info *rev);
Junio C Hamanoaf3feef2006-01-24 09:22:04221
Junio C Hamanoa5a818e2008-08-19 03:08:09222void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const char *b);
223
Junio C Hamano28b92642011-05-31 16:14:17224extern int diff_can_quit_early(struct diff_options *);
225
Junio C Hamano6b5ee132005-09-21 07:00:47226extern void diff_addremove(struct diff_options *,
227 int addremove,
Junio C Hamano77eb2722005-04-27 16:21:00228 unsigned mode,
229 const unsigned char *sha1,
Jeff Kinge5450102012-07-28 15:03:01230 int sha1_valid,
Jens Lehmanne3d42c42010-01-18 20:26:18231 const char *fullpath, unsigned dirty_submodule);
Junio C Hamano77eb2722005-04-27 16:21:00232
Junio C Hamano6b5ee132005-09-21 07:00:47233extern void diff_change(struct diff_options *,
234 unsigned mode1, unsigned mode2,
235 const unsigned char *sha1,
236 const unsigned char *sha2,
Jeff Kinge5450102012-07-28 15:03:01237 int sha1_valid,
238 int sha2_valid,
Jens Lehmanne3d42c42010-01-18 20:26:18239 const char *fullpath,
240 unsigned dirty_submodule1, unsigned dirty_submodule2);
Junio C Hamano77eb2722005-04-27 16:21:00241
Junio C Hamanofa7b2902011-04-22 23:05:58242extern struct diff_filepair *diff_unmerge(struct diff_options *, const char *path);
Junio C Hamano77eb2722005-04-27 16:21:00243
Junio C Hamano19feebc2005-05-27 22:54:37244#define DIFF_SETUP_REVERSE 1
Junio C Hamanof0c6b2a2005-05-27 22:56:38245#define DIFF_SETUP_USE_CACHE 2
246#define DIFF_SETUP_USE_SIZE_CACHE 4
Junio C Hamanoce240672005-06-03 08:36:43247
Matthieu Moydea007f2010-08-05 08:22:52248/*
Nicolas Vigierb0d12fc2013-10-31 11:08:28249 * Poor man's alternative to parse-option, to allow both stuck form
Matthieu Moydea007f2010-08-05 08:22:52250 * (--option=value) and separate form (--option value).
251 */
252extern int parse_long_opt(const char *opt, const char **argv,
253 const char **optarg);
254
Johannes Schindelinef90d6d2008-05-14 17:46:53255extern int git_diff_basic_config(const char *var, const char *value, void *cb);
256extern int git_diff_ui_config(const char *var, const char *value, void *cb);
Junio C Hamano6b5ee132005-09-21 07:00:47257extern void diff_setup(struct diff_options *);
258extern int diff_opt_parse(struct diff_options *, const char **, int);
Thomas Rast28452652012-08-03 12:16:24259extern void diff_setup_done(struct diff_options *);
Junio C Hamano86436c22005-04-26 01:22:47260
Junio C Hamano6b14d7f2005-05-22 17:04:37261#define DIFF_DETECT_RENAME 1
262#define DIFF_DETECT_COPY 2
263
Junio C Hamano367cec12005-05-27 22:55:28264#define DIFF_PICKAXE_ALL 1
Petr Baudisd01d8c62006-03-29 00:16:33265#define DIFF_PICKAXE_REGEX 2
Junio C Hamanof345b0a2005-05-30 07:08:37266
Junio C Hamanof506b8e2010-08-23 17:17:03267#define DIFF_PICKAXE_KIND_S 4 /* traditional plumbing counter */
268#define DIFF_PICKAXE_KIND_G 8 /* grep in the patch */
269
Junio C Hamano6b5ee132005-09-21 07:00:47270extern void diffcore_std(struct diff_options *);
Junio C Hamano730f7282009-09-20 07:03:39271extern void diffcore_fix_diff_index(struct diff_options *);
Junio C Hamanof2ce9fd2005-06-12 03:57:13272
Junio C Hamanodda2d792005-07-13 19:52:35273#define COMMON_DIFF_OPTIONS_HELP \
274"\ncommon diff options:\n" \
Junio C Hamano8082d8d2005-09-21 07:18:27275" -z output diff-raw with lines terminated with NUL.\n" \
276" -p output patch format.\n" \
277" -u synonym for -p.\n" \
Petr Baudis5c91da22006-04-11 11:22:17278" --patch-with-raw\n" \
279" output both a patch and the diff-raw format.\n" \
Johannes Schindelind75f7952006-04-13 22:15:30280" --stat show diffstat instead of patch.\n" \
Junio C Hamano74e2abe2006-10-12 10:01:00281" --numstat show numeric diffstat instead of patch.\n" \
Johannes Schindelin29353272006-04-15 11:41:18282" --patch-with-stat\n" \
283" output a patch and prepend its diffstat.\n" \
Junio C Hamano8082d8d2005-09-21 07:18:27284" --name-only show only names of changed files.\n" \
Junio C Hamano946f5f72005-09-21 07:20:06285" --name-status show names and status of changed files.\n" \
Junio C Hamano47dd0d52005-12-14 01:21:41286" --full-index show full object name on index lines.\n" \
Junio C Hamano913419f2005-12-18 10:03:15287" --abbrev=<n> abbreviate object names in diff-tree header and diff-raw.\n" \
Junio C Hamano8082d8d2005-09-21 07:18:27288" -R swap input file pairs.\n" \
289" -B detect complete rewrites.\n" \
290" -M detect renames.\n" \
291" -C detect copies.\n" \
Junio C Hamanodda2d792005-07-13 19:52:35292" --find-copies-harder\n" \
Junio C Hamano8082d8d2005-09-21 07:18:27293" try unchanged files as candidate for copy detection.\n" \
294" -l<n> limit rename attempts up to <n> paths.\n" \
295" -O<file> reorder diffs according to the <file>.\n" \
296" -S<string> find filepair whose only one side contains the string.\n" \
Junio C Hamanodda2d792005-07-13 19:52:35297" --pickaxe-all\n" \
Stephan Federca499202006-07-07 13:57:08298" show all files diff when -S is used and hit is found.\n" \
299" -a --text treat all files as text.\n"
Junio C Hamanodda2d792005-07-13 19:52:35300
Junio C Hamano38c6f782005-05-22 02:40:36301extern int diff_queue_is_empty(void);
Junio C Hamano6b5ee132005-09-21 07:00:47302extern void diff_flush(struct diff_options*);
Junio C Hamanof31027c2011-01-06 21:50:06303extern void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc);
Junio C Hamano86436c22005-04-26 01:22:47304
Junio C Hamanoe7baa4f2005-07-25 20:05:44305/* diff-raw status letters */
Junio C Hamanoca8c9152005-07-25 21:31:19306#define DIFF_STATUS_ADDED 'A'
Junio C Hamanoe7baa4f2005-07-25 20:05:44307#define DIFF_STATUS_COPIED 'C'
308#define DIFF_STATUS_DELETED 'D'
309#define DIFF_STATUS_MODIFIED 'M'
310#define DIFF_STATUS_RENAMED 'R'
311#define DIFF_STATUS_TYPE_CHANGED 'T'
312#define DIFF_STATUS_UNKNOWN 'X'
313#define DIFF_STATUS_UNMERGED 'U'
314
315/* these are not diff-raw status letters proper, but used by
316 * diffcore-filter insn to specify additional restrictions.
317 */
Junio C Hamano0b343792005-10-05 00:44:17318#define DIFF_STATUS_FILTER_AON '*'
Junio C Hamanoe7baa4f2005-07-25 20:05:44319#define DIFF_STATUS_FILTER_BROKEN 'B'
320
Junio C Hamano47dd0d52005-12-14 01:21:41321extern const char *diff_unique_abbrev(const unsigned char *, int);
322
Junio C Hamano4bd5b7d2007-11-10 08:15:03323/* do not report anything on removed paths */
324#define DIFF_SILENT_ON_REMOVED 01
Junio C Hamanofb63d7f2007-11-10 02:22:52325/* report racily-clean paths as modified */
326#define DIFF_RACY_IS_MODIFIED 02
Junio C Hamano4bd5b7d2007-11-10 08:15:03327extern int run_diff_files(struct rev_info *revs, unsigned int option);
Junio C Hamano5c21ac02006-04-22 10:58:04328extern int run_diff_index(struct rev_info *revs, int cached);
Junio C Hamanoe09ad6e2006-04-22 09:43:00329
Junio C Hamano1cfe7732007-01-30 09:11:08330extern int do_diff_cache(const unsigned char *, struct diff_options *);
Johannes Schindelinfcb3d0a2006-06-25 01:51:08331extern int diff_flush_patch_id(struct diff_options *, unsigned char *);
332
Junio C Hamanoda31b352007-12-14 07:40:27333extern int diff_result_code(struct diff_options *, int);
334
Thomas Gummerer470faf92013-12-11 09:58:42335extern void diff_no_index(struct rev_info *, int, const char **, const char *);
Junio C Hamano0569e9b2008-05-24 05:28:56336
Stephan Beyer75f3ff22009-02-10 14:30:35337extern int index_differs_from(const char *def, int diff_flags);
338
Axel Bonneta788d7d2010-06-07 15:23:36339extern size_t fill_textconv(struct userdiff_driver *driver,
340 struct diff_filespec *df,
341 char **outbuf);
342
343extern struct userdiff_driver *get_textconv(struct diff_filespec *one);
344
Kevin Ballard10ae7522010-09-27 23:58:25345extern int parse_rename_score(const char **cp_p);
346
Michal Privoznik07924d42013-01-16 07:51:58347extern long parse_algorithm_value(const char *value);
348
Junio C Hamano95a7c542013-07-18 00:18:32349extern void handle_deprecated_show_diff_q(struct diff_options *);
350
Nguyễn Thái Ngọc Duy7f814632012-02-01 12:55:07351extern int print_stat_summary(FILE *fp, int files,
352 int insertions, int deletions);
Nguyễn Thái Ngọc Duy4914c962012-10-26 15:53:52353extern void setup_diff_pager(struct diff_options *);
Nguyễn Thái Ngọc Duy7f814632012-02-01 12:55:07354
Junio C Hamano86436c22005-04-26 01:22:47355#endif /* DIFF_H */