Solaris: give a bit more built-in defaults.
[git/mingw.git] / diff.h
blob96c2312d86feff0b3b9901501aefa9b6ab55ce13
1 /*
2 * Copyright (C) 2005 Junio C Hamano
3 */
4 #ifndef DIFF_H
5 #define DIFF_H
7 #define DIFF_FILE_CANON_MODE(mode) \
8 (S_ISREG(mode) ? (S_IFREG | ce_permissions(mode)) : \
9 S_ISLNK(mode) ? S_IFLNK : S_IFDIR)
11 extern void diff_addremove(int addremove,
12 unsigned mode,
13 const unsigned char *sha1,
14 const char *base,
15 const char *path);
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);
22 extern void diff_unmerge(const char *path);
24 extern int diff_scoreopt_parse(const char *opt);
26 #define DIFF_SETUP_REVERSE 1
27 #define DIFF_SETUP_USE_CACHE 2
28 #define DIFF_SETUP_USE_SIZE_CACHE 4
30 extern void diff_setup(int flags);
32 #define DIFF_DETECT_RENAME 1
33 #define DIFF_DETECT_COPY 2
35 #define DIFF_PICKAXE_ALL 1
37 extern void diffcore_std(const char **paths,
38 int detect_rename, int rename_score,
39 const char *pickaxe, int pickaxe_opts,
40 int break_opt,
41 const char *orderfile, const char *filter);
43 extern void diffcore_std_no_resolve(const char **paths,
44 const char *pickaxe, int pickaxe_opts,
45 const char *orderfile, const char *filter);
47 #define COMMON_DIFF_OPTIONS_HELP \
48 "\ncommon diff options:\n" \
49 " -r diff recursively (only meaningful in diff-tree)\n" \
50 " -z output diff-raw with lines terminated with NUL.\n" \
51 " -p output patch format.\n" \
52 " -u synonym for -p.\n" \
53 " --name-only show only names of changed files.\n" \
54 " --name-only-z\n" \
55 " same as --name-only but terminate lines with NUL.\n" \
56 " -R swap input file pairs.\n" \
57 " -B detect complete rewrites.\n" \
58 " -M detect renames.\n" \
59 " -C detect copies.\n" \
60 " --find-copies-harder\n" \
61 " try unchanged files as candidate for copy detection.\n" \
62 " -O<file> reorder diffs according to the <file>.\n" \
63 " -S<string> find filepair whose only one side contains the string.\n" \
64 " --pickaxe-all\n" \
65 " show all files diff when -S is used and hit is found.\n"
67 extern int diff_queue_is_empty(void);
69 #define DIFF_FORMAT_RAW 1
70 #define DIFF_FORMAT_PATCH 2
71 #define DIFF_FORMAT_NO_OUTPUT 3
72 #define DIFF_FORMAT_NAME 4
74 extern void diff_flush(int output_style, int line_terminator);
76 /* diff-raw status letters */
77 #define DIFF_STATUS_ADDED 'A'
78 #define DIFF_STATUS_COPIED 'C'
79 #define DIFF_STATUS_DELETED 'D'
80 #define DIFF_STATUS_MODIFIED 'M'
81 #define DIFF_STATUS_RENAMED 'R'
82 #define DIFF_STATUS_TYPE_CHANGED 'T'
83 #define DIFF_STATUS_UNKNOWN 'X'
84 #define DIFF_STATUS_UNMERGED 'U'
86 /* these are not diff-raw status letters proper, but used by
87 * diffcore-filter insn to specify additional restrictions.
89 #define DIFF_STATUS_FILTER_AON 'A'
90 #define DIFF_STATUS_FILTER_BROKEN 'B'
92 #endif /* DIFF_H */