]>
Commit | Line | Data |
---|---|---|
be3cfa85 JH |
1 | /* |
2 | * Copyright (C) 2005 Junio C Hamano | |
3 | */ | |
86436c28 JH |
4 | #ifndef DIFF_H |
5 | #define DIFF_H | |
6 | ||
67574c40 JH |
7 | #define DIFF_FILE_CANON_MODE(mode) \ |
8 | (S_ISREG(mode) ? (S_IFREG | ce_permissions(mode)) : \ | |
9 | S_ISLNK(mode) ? S_IFLNK : S_IFDIR) | |
10 | ||
77eb2720 JH |
11 | extern void diff_addremove(int addremove, |
12 | unsigned mode, | |
13 | const unsigned char *sha1, | |
14 | const char *base, | |
15 | const char *path); | |
16 | ||
17 | extern void diff_change(unsigned mode1, unsigned mode2, | |
18 | const unsigned char *sha1, | |
19 | const unsigned char *sha2, | |
20 | const char *base, const char *path); | |
21 | ||
b6d8f309 JH |
22 | extern void diff_helper_input(unsigned mode1, |
23 | unsigned mode2, | |
24 | const unsigned char *sha1, | |
25 | const unsigned char *sha2, | |
26 | const char *path1, | |
27 | int status, | |
28 | int score, | |
29 | const char *path2); | |
81e50eab | 30 | |
77eb2720 JH |
31 | extern void diff_unmerge(const char *path); |
32 | ||
57fe64a4 JH |
33 | extern int diff_scoreopt_parse(const char *opt); |
34 | ||
19feebc8 | 35 | #define DIFF_SETUP_REVERSE 1 |
f0c6b2a2 JH |
36 | #define DIFF_SETUP_USE_CACHE 2 |
37 | #define DIFF_SETUP_USE_SIZE_CACHE 4 | |
ce240675 | 38 | |
19feebc8 | 39 | extern void diff_setup(int flags); |
86436c28 | 40 | |
6b14d7fa JH |
41 | #define DIFF_DETECT_RENAME 1 |
42 | #define DIFF_DETECT_COPY 2 | |
43 | ||
367cec1c | 44 | #define DIFF_PICKAXE_ALL 1 |
f345b0a0 | 45 | |
befe8639 JH |
46 | extern void diffcore_std(const char **paths, |
47 | int detect_rename, int rename_score, | |
f345b0a0 | 48 | const char *pickaxe, int pickaxe_opts, |
af5323e0 | 49 | int break_opt, |
f2ce9fde JH |
50 | const char *orderfile, const char *filter); |
51 | ||
52 | extern void diffcore_std_no_resolve(const char **paths, | |
53 | const char *pickaxe, int pickaxe_opts, | |
54 | const char *orderfile, const char *filter); | |
befe8639 | 55 | |
dda2d79a JH |
56 | #define COMMON_DIFF_OPTIONS_HELP \ |
57 | "\ncommon diff options:\n" \ | |
58 | " -r diff recursively (only meaningful in diff-tree)\n" \ | |
59 | " -z output diff-raw with lines terminated with NUL.\n" \ | |
60 | " -p output patch format.\n" \ | |
61 | " -u synonym for -p.\n" \ | |
62 | " --name-only show only names of changed files.\n" \ | |
63 | " --name-only-z\n" \ | |
64 | " same as --name-only but terminate lines with NUL.\n" \ | |
65 | " -R swap input file pairs.\n" \ | |
66 | " -B detect complete rewrites.\n" \ | |
67 | " -M detect renames.\n" \ | |
68 | " -C detect copies.\n" \ | |
69 | " --find-copies-harder\n" \ | |
70 | " try unchanged files as candidate for copy detection.\n" \ | |
71 | " -O<file> reorder diffs according to the <file>.\n" \ | |
72 | " -S<string> find filepair whose only one side contains the string.\n" \ | |
73 | " --pickaxe-all\n" \ | |
74 | " show all files diff when -S is used and hit is found.\n" | |
75 | ||
38c6f780 JH |
76 | extern int diff_queue_is_empty(void); |
77 | ||
e68b6f15 | 78 | #define DIFF_FORMAT_RAW 1 |
19feebc8 JH |
79 | #define DIFF_FORMAT_PATCH 2 |
80 | #define DIFF_FORMAT_NO_OUTPUT 3 | |
52f28529 | 81 | #define DIFF_FORMAT_NAME 4 |
19feebc8 | 82 | |
e68b6f15 | 83 | extern void diff_flush(int output_style, int line_terminator); |
86436c28 | 84 | |
e7baa4f4 | 85 | /* diff-raw status letters */ |
ca8c9156 | 86 | #define DIFF_STATUS_ADDED 'A' |
e7baa4f4 JH |
87 | #define DIFF_STATUS_COPIED 'C' |
88 | #define DIFF_STATUS_DELETED 'D' | |
89 | #define DIFF_STATUS_MODIFIED 'M' | |
90 | #define DIFF_STATUS_RENAMED 'R' | |
91 | #define DIFF_STATUS_TYPE_CHANGED 'T' | |
92 | #define DIFF_STATUS_UNKNOWN 'X' | |
93 | #define DIFF_STATUS_UNMERGED 'U' | |
94 | ||
95 | /* these are not diff-raw status letters proper, but used by | |
96 | * diffcore-filter insn to specify additional restrictions. | |
97 | */ | |
98 | #define DIFF_STATUS_FILTER_AON 'A' | |
99 | #define DIFF_STATUS_FILTER_BROKEN 'B' | |
100 | ||
86436c28 | 101 | #endif /* DIFF_H */ |