diff options
Diffstat (limited to 'man1/git-diff.1')
-rw-r--r-- | man1/git-diff.1 | 460 |
1 files changed, 457 insertions, 3 deletions
diff --git a/man1/git-diff.1 b/man1/git-diff.1 index 8e99a8742..b2ac4e3d3 100644 --- a/man1/git-diff.1 +++ b/man1/git-diff.1 @@ -2,12 +2,12 @@ .\" Title: git-diff .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 09/13/2022 +.\" Date: 09/14/2022 .\" Manual: Git Manual -.\" Source: Git 2.37.3.611.ge188ec3a73 +.\" Source: Git 2.37.3.662.g36f8e7ed7d .\" Language: English .\" -.TH "GIT\-DIFF" "1" "09/13/2022" "Git 2\&.37\&.3\&.611\&.ge188ec" "Git Manual" +.TH "GIT\-DIFF" "1" "09/14/2022" "Git 2\&.37\&.3\&.662\&.g36f8e7" "Git Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -2129,6 +2129,460 @@ $ git diff \-R \fB(2)\fR \fB2. \fROutput diff in reverse\&. .br .RE +.SH "CONFIGURATION" +.sp +Everything below this line in this section is selectively included from the \fBgit-config\fR(1) documentation\&. The content is the same as what\(cqs found there: +.PP +diff\&.autoRefreshIndex +.RS 4 +When using +\fIgit diff\fR +to compare with work tree files, do not consider stat\-only change as changed\&. Instead, silently run +\fBgit update\-index \-\-refresh\fR +to update the cached stat information for paths whose contents in the work tree match the contents in the index\&. This option defaults to true\&. Note that this affects only +\fIgit diff\fR +Porcelain, and not lower level +\fIdiff\fR +commands such as +\fIgit diff\-files\fR\&. +.RE +.PP +diff\&.dirstat +.RS 4 +A comma separated list of +\fB\-\-dirstat\fR +parameters specifying the default behavior of the +\fB\-\-dirstat\fR +option to +\fBgit-diff\fR(1) +and friends\&. The defaults can be overridden on the command line (using +\fB\-\-dirstat=<param1,param2,\&.\&.\&.>\fR)\&. The fallback defaults (when not changed by +\fBdiff\&.dirstat\fR) are +\fBchanges,noncumulative,3\fR\&. The following parameters are available: +.PP +\fBchanges\fR +.RS 4 +Compute the dirstat numbers by counting the lines that have been removed from the source, or added to the destination\&. This ignores the amount of pure code movements within a file\&. In other words, rearranging lines in a file is not counted as much as other changes\&. This is the default behavior when no parameter is given\&. +.RE +.PP +\fBlines\fR +.RS 4 +Compute the dirstat numbers by doing the regular line\-based diff analysis, and summing the removed/added line counts\&. (For binary files, count 64\-byte chunks instead, since binary files have no natural concept of lines)\&. This is a more expensive +\fB\-\-dirstat\fR +behavior than the +\fBchanges\fR +behavior, but it does count rearranged lines within a file as much as other changes\&. The resulting output is consistent with what you get from the other +\fB\-\-*stat\fR +options\&. +.RE +.PP +\fBfiles\fR +.RS 4 +Compute the dirstat numbers by counting the number of files changed\&. Each changed file counts equally in the dirstat analysis\&. This is the computationally cheapest +\fB\-\-dirstat\fR +behavior, since it does not have to look at the file contents at all\&. +.RE +.PP +\fBcumulative\fR +.RS 4 +Count changes in a child directory for the parent directory as well\&. Note that when using +\fBcumulative\fR, the sum of the percentages reported may exceed 100%\&. The default (non\-cumulative) behavior can be specified with the +\fBnoncumulative\fR +parameter\&. +.RE +.PP +<limit> +.RS 4 +An integer parameter specifies a cut\-off percent (3% by default)\&. Directories contributing less than this percentage of the changes are not shown in the output\&. +.RE +.sp +Example: The following will count changed files, while ignoring directories with less than 10% of the total amount of changed files, and accumulating child directory counts in the parent directories: +\fBfiles,10,cumulative\fR\&. +.RE +.PP +diff\&.statGraphWidth +.RS 4 +Limit the width of the graph part in \-\-stat output\&. If set, applies to all commands generating \-\-stat output except format\-patch\&. +.RE +.PP +diff\&.context +.RS 4 +Generate diffs with <n> lines of context instead of the default of 3\&. This value is overridden by the \-U option\&. +.RE +.PP +diff\&.interHunkContext +.RS 4 +Show the context between diff hunks, up to the specified number of lines, thereby fusing the hunks that are close to each other\&. This value serves as the default for the +\fB\-\-inter\-hunk\-context\fR +command line option\&. +.RE +.PP +diff\&.external +.RS 4 +If this config variable is set, diff generation is not performed using the internal diff machinery, but using the given command\&. Can be overridden with the \(oqGIT_EXTERNAL_DIFF\(cq environment variable\&. The command is called with parameters as described under "git Diffs" in +\fBgit\fR(1)\&. Note: if you want to use an external diff program only on a subset of your files, you might want to use +\fBgitattributes\fR(5) +instead\&. +.RE +.PP +diff\&.ignoreSubmodules +.RS 4 +Sets the default value of \-\-ignore\-submodules\&. Note that this affects only +\fIgit diff\fR +Porcelain, and not lower level +\fIdiff\fR +commands such as +\fIgit diff\-files\fR\&. +\fIgit checkout\fR +and +\fIgit switch\fR +also honor this setting when reporting uncommitted changes\&. Setting it to +\fIall\fR +disables the submodule summary normally shown by +\fIgit commit\fR +and +\fIgit status\fR +when +\fBstatus\&.submoduleSummary\fR +is set unless it is overridden by using the \-\-ignore\-submodules command\-line option\&. The +\fIgit submodule\fR +commands are not affected by this setting\&. By default this is set to untracked so that any untracked submodules are ignored\&. +.RE +.PP +diff\&.mnemonicPrefix +.RS 4 +If set, +\fIgit diff\fR +uses a prefix pair that is different from the standard "a/" and "b/" depending on what is being compared\&. When this configuration is in effect, reverse diff output also swaps the order of the prefixes: +.PP +\fBgit diff\fR +.RS 4 +compares the (i)ndex and the (w)ork tree; +.RE +.PP +\fBgit diff HEAD\fR +.RS 4 +compares a (c)ommit and the (w)ork tree; +.RE +.PP +\fBgit diff \-\-cached\fR +.RS 4 +compares a (c)ommit and the (i)ndex; +.RE +.PP +\fBgit diff HEAD:file1 file2\fR +.RS 4 +compares an (o)bject and a (w)ork tree entity; +.RE +.PP +\fBgit diff \-\-no\-index a b\fR +.RS 4 +compares two non\-git things (1) and (2)\&. +.RE +.RE +.PP +diff\&.noprefix +.RS 4 +If set, +\fIgit diff\fR +does not show any source or destination prefix\&. +.RE +.PP +diff\&.relative +.RS 4 +If set to +\fItrue\fR, +\fIgit diff\fR +does not show changes outside of the directory and show pathnames relative to the current directory\&. +.RE +.PP +diff\&.orderFile +.RS 4 +File indicating how to order files within a diff\&. See the +\fI\-O\fR +option to +\fBgit-diff\fR(1) +for details\&. If +\fBdiff\&.orderFile\fR +is a relative pathname, it is treated as relative to the top of the working tree\&. +.RE +.PP +diff\&.renameLimit +.RS 4 +The number of files to consider in the exhaustive portion of copy/rename detection; equivalent to the +\fIgit diff\fR +option +\fB\-l\fR\&. If not set, the default value is currently 1000\&. This setting has no effect if rename detection is turned off\&. +.RE +.PP +diff\&.renames +.RS 4 +Whether and how Git detects renames\&. If set to "false", rename detection is disabled\&. If set to "true", basic rename detection is enabled\&. If set to "copies" or "copy", Git will detect copies, as well\&. Defaults to true\&. Note that this affects only +\fIgit diff\fR +Porcelain like +\fBgit-diff\fR(1) +and +\fBgit-log\fR(1), and not lower level commands such as +\fBgit-diff-files\fR(1)\&. +.RE +.PP +diff\&.suppressBlankEmpty +.RS 4 +A boolean to inhibit the standard behavior of printing a space before each empty output line\&. Defaults to false\&. +.RE +.PP +diff\&.submodule +.RS 4 +Specify the format in which differences in submodules are shown\&. The "short" format just shows the names of the commits at the beginning and end of the range\&. The "log" format lists the commits in the range like +\fBgit-submodule\fR(1) +\fBsummary\fR +does\&. The "diff" format shows an inline diff of the changed contents of the submodule\&. Defaults to "short"\&. +.RE +.PP +diff\&.wordRegex +.RS 4 +A POSIX Extended Regular Expression used to determine what is a "word" when performing word\-by\-word difference calculations\&. Character sequences that match the regular expression are "words", all other characters are +\fBignorable\fR +whitespace\&. +.RE +.PP +diff\&.<driver>\&.command +.RS 4 +The custom diff driver command\&. See +\fBgitattributes\fR(5) +for details\&. +.RE +.PP +diff\&.<driver>\&.xfuncname +.RS 4 +The regular expression that the diff driver should use to recognize the hunk header\&. A built\-in pattern may also be used\&. See +\fBgitattributes\fR(5) +for details\&. +.RE +.PP +diff\&.<driver>\&.binary +.RS 4 +Set this option to true to make the diff driver treat files as binary\&. See +\fBgitattributes\fR(5) +for details\&. +.RE +.PP +diff\&.<driver>\&.textconv +.RS 4 +The command that the diff driver should call to generate the text\-converted version of a file\&. The result of the conversion is used to generate a human\-readable diff\&. See +\fBgitattributes\fR(5) +for details\&. +.RE +.PP +diff\&.<driver>\&.wordRegex +.RS 4 +The regular expression that the diff driver should use to split words in a line\&. See +\fBgitattributes\fR(5) +for details\&. +.RE +.PP +diff\&.<driver>\&.cachetextconv +.RS 4 +Set this option to true to make the diff driver cache the text conversion outputs\&. See +\fBgitattributes\fR(5) +for details\&. +.PP +\fBaraxis\fR +.RS 4 +Use Araxis Merge (requires a graphical session) +.RE +.PP +\fBbc\fR +.RS 4 +Use Beyond Compare (requires a graphical session) +.RE +.PP +\fBbc3\fR +.RS 4 +Use Beyond Compare (requires a graphical session) +.RE +.PP +\fBbc4\fR +.RS 4 +Use Beyond Compare (requires a graphical session) +.RE +.PP +\fBcodecompare\fR +.RS 4 +Use Code Compare (requires a graphical session) +.RE +.PP +\fBdeltawalker\fR +.RS 4 +Use DeltaWalker (requires a graphical session) +.RE +.PP +\fBdiffmerge\fR +.RS 4 +Use DiffMerge (requires a graphical session) +.RE +.PP +\fBdiffuse\fR +.RS 4 +Use Diffuse (requires a graphical session) +.RE +.PP +\fBecmerge\fR +.RS 4 +Use ECMerge (requires a graphical session) +.RE +.PP +\fBemerge\fR +.RS 4 +Use Emacs\(aq Emerge +.RE +.PP +\fBexamdiff\fR +.RS 4 +Use ExamDiff Pro (requires a graphical session) +.RE +.PP +\fBguiffy\fR +.RS 4 +Use Guiffy\(cqs Diff Tool (requires a graphical session) +.RE +.PP +\fBgvimdiff\fR +.RS 4 +Use gVim (requires a graphical session) +.RE +.PP +\fBkdiff3\fR +.RS 4 +Use KDiff3 (requires a graphical session) +.RE +.PP +\fBkompare\fR +.RS 4 +Use Kompare (requires a graphical session) +.RE +.PP +\fBmeld\fR +.RS 4 +Use Meld (requires a graphical session) +.RE +.PP +\fBnvimdiff\fR +.RS 4 +Use Neovim +.RE +.PP +\fBopendiff\fR +.RS 4 +Use FileMerge (requires a graphical session) +.RE +.PP +\fBp4merge\fR +.RS 4 +Use HelixCore P4Merge (requires a graphical session) +.RE +.PP +\fBsmerge\fR +.RS 4 +Use Sublime Merge (requires a graphical session) +.RE +.PP +\fBtkdiff\fR +.RS 4 +Use TkDiff (requires a graphical session) +.RE +.PP +\fBvimdiff\fR +.RS 4 +Use Vim +.RE +.PP +\fBwinmerge\fR +.RS 4 +Use WinMerge (requires a graphical session) +.RE +.PP +\fBxxdiff\fR +.RS 4 +Use xxdiff (requires a graphical session) +.RE +.RE +.PP +diff\&.indentHeuristic +.RS 4 +Set this option to +\fBfalse\fR +to disable the default heuristics that shift diff hunk boundaries to make patches easier to read\&. +.RE +.PP +diff\&.algorithm +.RS 4 +Choose a diff algorithm\&. The variants are as follows: +.PP +\fBdefault\fR, \fBmyers\fR +.RS 4 +The basic greedy diff algorithm\&. Currently, this is the default\&. +.RE +.PP +\fBminimal\fR +.RS 4 +Spend extra time to make sure the smallest possible diff is produced\&. +.RE +.PP +\fBpatience\fR +.RS 4 +Use "patience diff" algorithm when generating patches\&. +.RE +.PP +\fBhistogram\fR +.RS 4 +This algorithm extends the patience algorithm to "support low\-occurrence common elements"\&. +.RE +.RE +.PP +diff\&.wsErrorHighlight +.RS 4 +Highlight whitespace errors in the +\fBcontext\fR, +\fBold\fR +or +\fBnew\fR +lines of the diff\&. Multiple values are separated by comma, +\fBnone\fR +resets previous values, +\fBdefault\fR +reset the list to +\fBnew\fR +and +\fBall\fR +is a shorthand for +\fBold,new,context\fR\&. The whitespace errors are colored with +\fBcolor\&.diff\&.whitespace\fR\&. The command line option +\fB\-\-ws\-error\-highlight=<kind>\fR +overrides this setting\&. +.RE +.PP +diff\&.colorMoved +.RS 4 +If set to either a valid +\fB<mode>\fR +or a true value, moved lines in a diff are colored differently, for details of valid modes see +\fI\-\-color\-moved\fR +in +\fBgit-diff\fR(1)\&. If simply set to true the default color mode will be used\&. When set to false, moved lines are not colored\&. +.RE +.PP +diff\&.colorMovedWS +.RS 4 +When moved lines are colored using e\&.g\&. the +\fBdiff\&.colorMoved\fR +setting, this option controls the +\fB<mode>\fR +how spaces are treated for details of valid modes see +\fI\-\-color\-moved\-ws\fR +in +\fBgit-diff\fR(1)\&. +.RE .SH "SEE ALSO" .sp diff(1), \fBgit-difftool\fR(1), \fBgit-log\fR(1), \fBgitdiffcore\fR(7), \fBgit-format-patch\fR(1), \fBgit-apply\fR(1), \fBgit-show\fR(1) |