Add config variable for specifying default --dirstat behavior
[git] / Documentation / diff-config.txt
1 diff.autorefreshindex::
2         When using 'git diff' to compare with work tree
3         files, do not consider stat-only change as changed.
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
11 diff.dirstat::
12         A comma separated list of `--dirstat` parameters specifying the
13         default behavior of the `--dirstat` option to linkgit:git-diff[1]`
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.
26 `files`;;
27         Compute the dirstat numbers by counting the number of files changed.
28         Each changed file counts equally in the dirstat analysis. This is
29         the computationally cheapest `--dirstat` behavior, since it does
30         not have to look at the file contents at all.
31 `cumulative`;;
32         Count changes in a child directory for the parent directory as well.
33         Note that when using `cumulative`, the sum of the percentages
34         reported may exceed 100%. The default (non-cumulative) behavior can
35         be specified with the `noncumulative` parameter.
36 <limit>;;
37         An integer parameter specifies a cut-off percent (3% by default).
38         Directories contributing less than this percentage of the changes
39         are not shown in the output.
40 --
41 +
42 Example: The following will count changed files, while ignoring
43 directories with less than 10% of the total amount of changed files,
44 and accumulating child directory counts in the parent directories:
45 `files,10,cumulative`.
46
47 diff.external::
48         If this config variable is set, diff generation is not
49         performed using the internal diff machinery, but using the
50         given command.  Can be overridden with the `GIT_EXTERNAL_DIFF'
51         environment variable.  The command is called with parameters
52         as described under "git Diffs" in linkgit:git[1].  Note: if
53         you want to use an external diff program only on a subset of
54         your files, you might want to use linkgit:gitattributes[5] instead.
55
56 diff.ignoreSubmodules::
57         Sets the default value of --ignore-submodules. Note that this
58         affects only 'git diff' Porcelain, and not lower level 'diff'
59         commands such as 'git diff-files'. 'git checkout' also honors
60         this setting when reporting uncommitted changes.
61
62 diff.mnemonicprefix::
63         If set, 'git diff' uses a prefix pair that is different from the
64         standard "a/" and "b/" depending on what is being compared.  When
65         this configuration is in effect, reverse diff output also swaps
66         the order of the prefixes:
67 `git diff`;;
68         compares the (i)ndex and the (w)ork tree;
69 `git diff HEAD`;;
70          compares a (c)ommit and the (w)ork tree;
71 `git diff --cached`;;
72         compares a (c)ommit and the (i)ndex;
73 `git diff HEAD:file1 file2`;;
74         compares an (o)bject and a (w)ork tree entity;
75 `git diff --no-index a b`;;
76         compares two non-git things (1) and (2).
77
78 diff.noprefix::
79         If set, 'git diff' does not show any source or destination prefix.
80
81 diff.renameLimit::
82         The number of files to consider when performing the copy/rename
83         detection; equivalent to the 'git diff' option '-l'.
84
85 diff.renames::
86         Tells git to detect renames.  If set to any boolean value, it
87         will enable basic rename detection.  If set to "copies" or
88         "copy", it will detect copies, as well.
89
90 diff.suppressBlankEmpty::
91         A boolean to inhibit the standard behavior of printing a space
92         before each empty output line. Defaults to false.
93
94 diff.<driver>.command::
95         The custom diff driver command.  See linkgit:gitattributes[5]
96         for details.
97
98 diff.<driver>.xfuncname::
99         The regular expression that the diff driver should use to
100         recognize the hunk header.  A built-in pattern may also be used.
101         See linkgit:gitattributes[5] for details.
102
103 diff.<driver>.binary::
104         Set this option to true to make the diff driver treat files as
105         binary.  See linkgit:gitattributes[5] for details.
106
107 diff.<driver>.textconv::
108         The command that the diff driver should call to generate the
109         text-converted version of a file.  The result of the
110         conversion is used to generate a human-readable diff.  See
111         linkgit:gitattributes[5] for details.
112
113 diff.<driver>.wordregex::
114         The regular expression that the diff driver should use to
115         split words in a line.  See linkgit:gitattributes[5] for
116         details.
117
118 diff.<driver>.cachetextconv::
119         Set this option to true to make the diff driver cache the text
120         conversion outputs.  See linkgit:gitattributes[5] for details.
121
122 diff.tool::
123         The diff tool to be used by linkgit:git-difftool[1].  This
124         option overrides `merge.tool`, and has the same valid built-in
125         values as `merge.tool` minus "tortoisemerge" and plus
126         "kompare".  Any other value is treated as a custom diff tool,
127         and there must be a corresponding `difftool.<tool>.cmd`
128         option.