]>
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 | ||
6b5ee137 JH |
11 | struct diff_options { |
12 | const char **paths; | |
13 | const char *filter; | |
14 | const char *orderfile; | |
15 | const char *pickaxe; | |
16 | int break_opt; | |
17 | int detect_rename; | |
18 | int find_copies_harder; | |
19 | int line_termination; | |
20 | int output_format; | |
21 | int pickaxe_opts; | |
22 | int rename_score; | |
23 | int reverse_diff; | |
8082d8d3 | 24 | int rename_limit; |
6b5ee137 JH |
25 | int setup; |
26 | }; | |
27 | ||
28 | extern void diff_addremove(struct diff_options *, | |
29 | int addremove, | |
77eb2720 JH |
30 | unsigned mode, |
31 | const unsigned char *sha1, | |
32 | const char *base, | |
33 | const char *path); | |
34 | ||
6b5ee137 JH |
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); | |
77eb2720 | 40 | |
6b5ee137 JH |
41 | extern void diff_unmerge(struct diff_options *, |
42 | const char *path); | |
77eb2720 | 43 | |
57fe64a4 JH |
44 | extern int diff_scoreopt_parse(const char *opt); |
45 | ||
19feebc8 | 46 | #define DIFF_SETUP_REVERSE 1 |
f0c6b2a2 JH |
47 | #define DIFF_SETUP_USE_CACHE 2 |
48 | #define DIFF_SETUP_USE_SIZE_CACHE 4 | |
ce240675 | 49 | |
6b5ee137 JH |
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 *); | |
86436c28 | 53 | |
6b14d7fa JH |
54 | #define DIFF_DETECT_RENAME 1 |
55 | #define DIFF_DETECT_COPY 2 | |
56 | ||
367cec1c | 57 | #define DIFF_PICKAXE_ALL 1 |
f345b0a0 | 58 | |
6b5ee137 | 59 | extern void diffcore_std(struct diff_options *); |
f2ce9fde | 60 | |
6b5ee137 | 61 | extern void diffcore_std_no_resolve(struct diff_options *); |
befe8639 | 62 | |
dda2d79a JH |
63 | #define COMMON_DIFF_OPTIONS_HELP \ |
64 | "\ncommon diff options:\n" \ | |
8082d8d3 JH |
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" \ | |
946f5f7c | 70 | " --name-status show names and status of changed files.\n" \ |
8082d8d3 JH |
71 | " -R swap input file pairs.\n" \ |
72 | " -B detect complete rewrites.\n" \ | |
73 | " -M detect renames.\n" \ | |
74 | " -C detect copies.\n" \ | |
dda2d79a | 75 | " --find-copies-harder\n" \ |
8082d8d3 JH |
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" \ | |
dda2d79a | 80 | " --pickaxe-all\n" \ |
8082d8d3 | 81 | " show all files diff when -S is used and hit is found.\n" |
dda2d79a | 82 | |
38c6f780 JH |
83 | extern int diff_queue_is_empty(void); |
84 | ||
e68b6f15 | 85 | #define DIFF_FORMAT_RAW 1 |
19feebc8 JH |
86 | #define DIFF_FORMAT_PATCH 2 |
87 | #define DIFF_FORMAT_NO_OUTPUT 3 | |
52f28529 | 88 | #define DIFF_FORMAT_NAME 4 |
946f5f7c | 89 | #define DIFF_FORMAT_NAME_STATUS 5 |
19feebc8 | 90 | |
6b5ee137 | 91 | extern void diff_flush(struct diff_options*); |
86436c28 | 92 | |
e7baa4f4 | 93 | /* diff-raw status letters */ |
ca8c9156 | 94 | #define DIFF_STATUS_ADDED 'A' |
e7baa4f4 JH |
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' | |
102 | ||
103 | /* these are not diff-raw status letters proper, but used by | |
104 | * diffcore-filter insn to specify additional restrictions. | |
105 | */ | |
106 | #define DIFF_STATUS_FILTER_AON 'A' | |
107 | #define DIFF_STATUS_FILTER_BROKEN 'B' | |
108 | ||
86436c28 | 109 | #endif /* DIFF_H */ |