2 * Copyright (C) 2005 Junio C Hamano
7 #define DIFF_FILE_CANON_MODE(mode) \
8 (S_ISREG(mode) ? (S_IFREG | ce_permissions(mode)) : \
9 S_ISLNK(mode) ? S_IFLNK : S_IFDIR)
14 const char *orderfile
;
18 int find_copies_harder
;
28 extern void diff_addremove(struct diff_options
*,
31 const unsigned char *sha1
,
35 extern void diff_change(struct diff_options
*,
36 unsigned mode1
, unsigned mode2
,
37 const unsigned char *sha1
,
38 const unsigned char *sha2
,
39 const char *base
, const char *path
);
41 extern void diff_unmerge(struct diff_options
*,
44 extern int diff_scoreopt_parse(const char *opt
);
46 #define DIFF_SETUP_REVERSE 1
47 #define DIFF_SETUP_USE_CACHE 2
48 #define DIFF_SETUP_USE_SIZE_CACHE 4
50 extern void diff_setup(struct diff_options
*);
51 extern int diff_opt_parse(struct diff_options
*, const char **, int);
52 extern int diff_setup_done(struct diff_options
*);
54 #define DIFF_DETECT_RENAME 1
55 #define DIFF_DETECT_COPY 2
57 #define DIFF_PICKAXE_ALL 1
59 extern void diffcore_std(struct diff_options
*);
61 extern void diffcore_std_no_resolve(struct diff_options
*);
63 #define COMMON_DIFF_OPTIONS_HELP \
64 "\ncommon diff options:\n" \
65 " -r diff recursively (only meaningful in diff-tree)\n" \
66 " -z output diff-raw with lines terminated with NUL.\n" \
67 " -p output patch format.\n" \
68 " -u synonym for -p.\n" \
69 " --name-only show only names of changed files.\n" \
70 " -R swap input file pairs.\n" \
71 " -B detect complete rewrites.\n" \
72 " -M detect renames.\n" \
73 " -C detect copies.\n" \
74 " --find-copies-harder\n" \
75 " try unchanged files as candidate for copy detection.\n" \
76 " -l<n> limit rename attempts up to <n> paths.\n" \
77 " -O<file> reorder diffs according to the <file>.\n" \
78 " -S<string> find filepair whose only one side contains the string.\n" \
80 " show all files diff when -S is used and hit is found.\n"
82 extern int diff_queue_is_empty(void);
84 #define DIFF_FORMAT_RAW 1
85 #define DIFF_FORMAT_PATCH 2
86 #define DIFF_FORMAT_NO_OUTPUT 3
87 #define DIFF_FORMAT_NAME 4
89 extern void diff_flush(struct diff_options
*);
91 /* diff-raw status letters */
92 #define DIFF_STATUS_ADDED 'A'
93 #define DIFF_STATUS_COPIED 'C'
94 #define DIFF_STATUS_DELETED 'D'
95 #define DIFF_STATUS_MODIFIED 'M'
96 #define DIFF_STATUS_RENAMED 'R'
97 #define DIFF_STATUS_TYPE_CHANGED 'T'
98 #define DIFF_STATUS_UNKNOWN 'X'
99 #define DIFF_STATUS_UNMERGED 'U'
101 /* these are not diff-raw status letters proper, but used by
102 * diffcore-filter insn to specify additional restrictions.
104 #define DIFF_STATUS_FILTER_AON 'A'
105 #define DIFF_STATUS_FILTER_BROKEN 'B'