]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/config/diff.txt
Merge branch 'ja/docfixes' into HEAD
[thirdparty/git.git] / Documentation / config / diff.txt
CommitLineData
da0005b8 1diff.autoRefreshIndex::
19299a84 2 When using 'git diff' to compare with work tree
6cc668c0 3 files, do not consider stat-only changes as changed.
19299a84
RR
4 Instead, silently run `git update-index --refresh` to
5 update the cached stat information for paths whose
6 contents in the work tree match the contents in the
7 index. This option defaults to true. Note that this
8 affects only 'git diff' Porcelain, and not lower level
9 'diff' commands such as 'git diff-files'.
10
2d174951
JH
11diff.dirstat::
12 A comma separated list of `--dirstat` parameters specifying the
ef39d22f 13 default behavior of the `--dirstat` option to linkgit:git-diff[1]
2d174951
JH
14 and friends. The defaults can be overridden on the command line
15 (using `--dirstat=<param1,param2,...>`). The fallback defaults
16 (when not changed by `diff.dirstat`) are `changes,noncumulative,3`.
17 The following parameters are available:
18+
19--
20`changes`;;
21 Compute the dirstat numbers by counting the lines that have been
22 removed from the source, or added to the destination. This ignores
23 the amount of pure code movements within a file. In other words,
24 rearranging lines in a file is not counted as much as other changes.
25 This is the default behavior when no parameter is given.
1c57a627
JH
26`lines`;;
27 Compute the dirstat numbers by doing the regular line-based diff
28 analysis, and summing the removed/added line counts. (For binary
29 files, count 64-byte chunks instead, since binary files have no
30 natural concept of lines). This is a more expensive `--dirstat`
31 behavior than the `changes` behavior, but it does count rearranged
32 lines within a file as much as other changes. The resulting output
33 is consistent with what you get from the other `--*stat` options.
2d174951
JH
34`files`;;
35 Compute the dirstat numbers by counting the number of files changed.
36 Each changed file counts equally in the dirstat analysis. This is
37 the computationally cheapest `--dirstat` behavior, since it does
38 not have to look at the file contents at all.
39`cumulative`;;
40 Count changes in a child directory for the parent directory as well.
41 Note that when using `cumulative`, the sum of the percentages
42 reported may exceed 100%. The default (non-cumulative) behavior can
43 be specified with the `noncumulative` parameter.
44<limit>;;
45 An integer parameter specifies a cut-off percent (3% by default).
46 Directories contributing less than this percentage of the changes
47 are not shown in the output.
48--
49+
50Example: The following will count changed files, while ignoring
51directories with less than 10% of the total amount of changed files,
52and accumulating child directory counts in the parent directories:
53`files,10,cumulative`.
54
bd48adc3
DS
55diff.statNameWidth::
56 Limit the width of the filename part in --stat output. If set, applies
57 to all commands generating --stat output except format-patch.
58
df44483a
ZJS
59diff.statGraphWidth::
60 Limit the width of the graph part in --stat output. If set, applies
b4ab1980 61 to all commands generating --stat output except format-patch.
df44483a 62
6468a4e5 63diff.context::
00704e4b
JH
64 Generate diffs with <n> lines of context instead of the default
65 of 3. This value is overridden by the -U option.
6468a4e5 66
c4888677
VN
67diff.interHunkContext::
68 Show the context between diff hunks, up to the specified number
69 of lines, thereby fusing the hunks that are close to each other.
70 This value serves as the default for the `--inter-hunk-context`
71 command line option.
72
19299a84
RR
73diff.external::
74 If this config variable is set, diff generation is not
75 performed using the internal diff machinery, but using the
76 given command. Can be overridden with the `GIT_EXTERNAL_DIFF'
77 environment variable. The command is called with parameters
78 as described under "git Diffs" in linkgit:git[1]. Note: if
79 you want to use an external diff program only on a subset of
8d75a1d1 80 your files, you might want to use linkgit:gitattributes[5] instead.
19299a84
RR
81
82diff.ignoreSubmodules::
83 Sets the default value of --ignore-submodules. Note that this
84 affects only 'git diff' Porcelain, and not lower level 'diff'
d787d311
NTND
85 commands such as 'git diff-files'. 'git checkout'
86 and 'git switch' also honor
bb58b696
JL
87 this setting when reporting uncommitted changes. Setting it to
88 'all' disables the submodule summary normally shown by 'git commit'
ae9f6311 89 and 'git status' when `status.submoduleSummary` is set unless it is
06ab60c0 90 overridden by using the --ignore-submodules command-line option.
bb58b696 91 The 'git submodule' commands are not affected by this setting.
8ef93124
SJ
92 By default this is set to untracked so that any untracked
93 submodules are ignored.
19299a84 94
da0005b8 95diff.mnemonicPrefix::
19299a84
RR
96 If set, 'git diff' uses a prefix pair that is different from the
97 standard "a/" and "b/" depending on what is being compared. When
98 this configuration is in effect, reverse diff output also swaps
99 the order of the prefixes:
100`git diff`;;
101 compares the (i)ndex and the (w)ork tree;
102`git diff HEAD`;;
103 compares a (c)ommit and the (w)ork tree;
104`git diff --cached`;;
105 compares a (c)ommit and the (i)ndex;
106`git diff HEAD:file1 file2`;;
107 compares an (o)bject and a (w)ork tree entity;
108`git diff --no-index a b`;;
109 compares two non-git things (1) and (2).
110
111diff.noprefix::
112 If set, 'git diff' does not show any source or destination prefix.
113
c28ded83
LA
114diff.relative::
115 If set to 'true', 'git diff' does not show changes outside of the directory
116 and show pathnames relative to the current directory.
117
da0005b8 118diff.orderFile::
874444b7
RH
119 File indicating how to order files within a diff.
120 See the '-O' option to linkgit:git-diff[1] for details.
1a5fccc0
RH
121 If `diff.orderFile` is a relative pathname, it is treated as
122 relative to the top of the working tree.
6d8940b5 123
19299a84 124diff.renameLimit::
6623a528
EN
125 The number of files to consider in the exhaustive portion of
126 copy/rename detection; equivalent to the 'git diff' option
94b82d56 127 `-l`. If not set, the default value is currently 1000. This
6623a528 128 setting has no effect if rename detection is turned off.
19299a84
RR
129
130diff.renames::
62df1e68
MM
131 Whether and how Git detects renames. If set to "false",
132 rename detection is disabled. If set to "true", basic rename
133 detection is enabled. If set to "copies" or "copy", Git will
5404c116 134 detect copies, as well. Defaults to true. Note that this
62df1e68
MM
135 affects only 'git diff' Porcelain like linkgit:git-diff[1] and
136 linkgit:git-log[1], and not lower level commands such as
137 linkgit:git-diff-files[1].
19299a84
RR
138
139diff.suppressBlankEmpty::
140 A boolean to inhibit the standard behavior of printing a space
141 before each empty output line. Defaults to false.
142
c47ef57c
RR
143diff.submodule::
144 Specify the format in which differences in submodules are
fd47ae6a
JK
145 shown. The "short" format just shows the names of the commits
146 at the beginning and end of the range. The "log" format lists
147 the commits in the range like linkgit:git-submodule[1] `summary`
148 does. The "diff" format shows an inline diff of the changed
149 contents of the submodule. Defaults to "short".
c47ef57c 150
22bc70fd
RR
151diff.wordRegex::
152 A POSIX Extended Regular Expression used to determine what is a "word"
153 when performing word-by-word difference calculations. Character
154 sequences that match the regular expression are "words", all other
155 characters are *ignorable* whitespace.
156
90b94c26
RR
157diff.<driver>.command::
158 The custom diff driver command. See linkgit:gitattributes[5]
159 for details.
160
161diff.<driver>.xfuncname::
162 The regular expression that the diff driver should use to
163 recognize the hunk header. A built-in pattern may also be used.
164 See linkgit:gitattributes[5] for details.
165
166diff.<driver>.binary::
167 Set this option to true to make the diff driver treat files as
168 binary. See linkgit:gitattributes[5] for details.
169
170diff.<driver>.textconv::
171 The command that the diff driver should call to generate the
172 text-converted version of a file. The result of the
173 conversion is used to generate a human-readable diff. See
174 linkgit:gitattributes[5] for details.
175
da0005b8 176diff.<driver>.wordRegex::
90b94c26
RR
177 The regular expression that the diff driver should use to
178 split words in a line. See linkgit:gitattributes[5] for
179 details.
180
181diff.<driver>.cachetextconv::
182 Set this option to true to make the diff driver cache the text
183 conversion outputs. See linkgit:gitattributes[5] for details.
48672b3d 184
fa922d74 185include::../mergetools-diff.txt[]
07ab4dec 186
433860f3 187diff.indentHeuristic::
64e5e1fb 188 Set this option to `false` to disable the default heuristics
3cde4e02 189 that shift diff hunk boundaries to make patches easier to read.
5580b271 190
07ab4dec
MP
191diff.algorithm::
192 Choose a diff algorithm. The variants are as follows:
193+
194--
195`default`, `myers`;;
196 The basic greedy diff algorithm. Currently, this is the default.
197`minimal`;;
198 Spend extra time to make sure the smallest possible diff is
199 produced.
200`patience`;;
201 Use "patience diff" algorithm when generating patches.
202`histogram`;;
203 This algorithm extends the patience algorithm to "support
204 low-occurrence common elements".
205--
206+
a17505f2
JH
207
208diff.wsErrorHighlight::
c0bb6d9c
AH
209 Highlight whitespace errors in the `context`, `old` or `new`
210 lines of the diff. Multiple values are separated by comma,
211 `none` resets previous values, `default` reset the list to
212 `new` and `all` is a shorthand for `old,new,context`. The
213 whitespace errors are colored with `color.diff.whitespace`.
214 The command line option `--ws-error-highlight=<kind>`
215 overrides this setting.
eb90ea79
NTND
216
217diff.colorMoved::
218 If set to either a valid `<mode>` or a true value, moved lines
219 in a diff are colored differently, for details of valid modes
220 see '--color-moved' in linkgit:git-diff[1]. If simply set to
221 true the default color mode will be used. When set to false,
222 moved lines are not colored.
223
224diff.colorMovedWS::
225 When moved lines are colored using e.g. the `diff.colorMoved` setting,
abab32a6
JNA
226 this option controls the `<mode>` how spaces are treated.
227 For details of valid modes see '--color-moved-ws' in linkgit:git-diff[1].