Merge branch 'fixes'
[git/git.git] / diff.h
CommitLineData
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
11extern void diff_addremove(int addremove,
12 unsigned mode,
13 const unsigned char *sha1,
14 const char *base,
15 const char *path);
16
17extern 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
22extern void diff_unmerge(const char *path);
23
57fe64a4
JH
24extern int diff_scoreopt_parse(const char *opt);
25
19feebc8 26#define DIFF_SETUP_REVERSE 1
f0c6b2a2
JH
27#define DIFF_SETUP_USE_CACHE 2
28#define DIFF_SETUP_USE_SIZE_CACHE 4
ce240675 29
19feebc8 30extern void diff_setup(int flags);
86436c28 31
6b14d7fa
JH
32#define DIFF_DETECT_RENAME 1
33#define DIFF_DETECT_COPY 2
34
367cec1c 35#define DIFF_PICKAXE_ALL 1
f345b0a0 36
befe8639
JH
37extern void diffcore_std(const char **paths,
38 int detect_rename, int rename_score,
f345b0a0 39 const char *pickaxe, int pickaxe_opts,
af5323e0 40 int break_opt,
f2ce9fde
JH
41 const char *orderfile, const char *filter);
42
43extern void diffcore_std_no_resolve(const char **paths,
44 const char *pickaxe, int pickaxe_opts,
45 const char *orderfile, const char *filter);
befe8639 46
dda2d79a
JH
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"
66
38c6f780
JH
67extern int diff_queue_is_empty(void);
68
e68b6f15 69#define DIFF_FORMAT_RAW 1
19feebc8
JH
70#define DIFF_FORMAT_PATCH 2
71#define DIFF_FORMAT_NO_OUTPUT 3
52f28529 72#define DIFF_FORMAT_NAME 4
19feebc8 73
e68b6f15 74extern void diff_flush(int output_style, int line_terminator);
86436c28 75
e7baa4f4 76/* diff-raw status letters */
ca8c9156 77#define DIFF_STATUS_ADDED 'A'
e7baa4f4
JH
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'
85
86/* these are not diff-raw status letters proper, but used by
87 * diffcore-filter insn to specify additional restrictions.
88 */
89#define DIFF_STATUS_FILTER_AON 'A'
90#define DIFF_STATUS_FILTER_BROKEN 'B'
91
86436c28 92#endif /* DIFF_H */