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 " --name-status show names and status of changed files.\n" \
71 " -R swap input file pairs.\n" \
72 " -B detect complete rewrites.\n" \
73 " -M detect renames.\n" \
74 " -C detect copies.\n" \
75 " --find-copies-harder\n" \
76 " try unchanged files as candidate for copy detection.\n" \
77 " -l<n> limit rename attempts up to <n> paths.\n" \
78 " -O<file> reorder diffs according to the <file>.\n" \
79 " -S<string> find filepair whose only one side contains the string.\n" \
81 " show all files diff when -S is used and hit is found.\n"
83 extern int diff_queue_is_empty(void);
85 #define DIFF_FORMAT_RAW 1
86 #define DIFF_FORMAT_PATCH 2
87 #define DIFF_FORMAT_NO_OUTPUT 3
88 #define DIFF_FORMAT_NAME 4
89 #define DIFF_FORMAT_NAME_STATUS 5
91 extern void diff_flush(struct diff_options
*);
93 /* diff-raw status letters */
94 #define DIFF_STATUS_ADDED 'A'
95 #define DIFF_STATUS_COPIED 'C'
96 #define DIFF_STATUS_DELETED 'D'
97 #define DIFF_STATUS_MODIFIED 'M'
98 #define DIFF_STATUS_RENAMED 'R'
99 #define DIFF_STATUS_TYPE_CHANGED 'T'
100 #define DIFF_STATUS_UNKNOWN 'X'
101 #define DIFF_STATUS_UNMERGED 'U'
103 /* these are not diff-raw status letters proper, but used by
104 * diffcore-filter insn to specify additional restrictions.
106 #define DIFF_STATUS_FILTER_AON '*'
107 #define DIFF_STATUS_FILTER_BROKEN 'B'