Home Explore Blog CI



git

4th chunk of `Documentation/config/diff.adoc`
7e141ea47a49e9486d662f93058468bd4e1458c3c9ae2c700000000100000d9a
 `summary`
	does. The `diff` format shows an inline diff of the changed
	contents of the submodule. Defaults to `short`.

`diff.wordRegex`::
	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 *ignorable* whitespace.

`diff.<driver>.command`::
	The custom diff driver command.  See linkgit:gitattributes[5]
	for details.

`diff.<driver>.trustExitCode`::
	If this boolean value is set to `true` then the
	`diff.<driver>.command` command is expected to return exit code
	0 if it considers the input files to be equal or 1 if it
	considers them to be different, like `diff`(1).
	If it is set to `false`, which is the default, then the command
	is expected to return exit code 0 regardless of equality.
	Any other exit code causes Git to report a fatal error.

`diff.<driver>.xfuncname`::
	The regular expression that the diff driver should use to
	recognize the hunk header.  A built-in pattern may also be used.
	See linkgit:gitattributes[5] for details.

`diff.<driver>.binary`::
	Set this option to `true` to make the diff driver treat files as
	binary.  See linkgit:gitattributes[5] for details.

`diff.<driver>.textconv`::
	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
	linkgit:gitattributes[5] for details.

`diff.<driver>.wordRegex`::
	The regular expression that the diff driver should use to
	split words in a line.  See linkgit:gitattributes[5] for
	details.

`diff.<driver>.cachetextconv`::
	Set this option to `true` to make the diff driver cache the text
	conversion outputs.  See linkgit:gitattributes[5] for details.

`diff.indentHeuristic`::
	Set this option to `false` to disable the default heuristics
	that shift diff hunk boundaries to make patches easier to read.

`diff.algorithm`::
	Choose a diff algorithm.  The variants are as follows:
+
--
`default`;;
`myers`;;
	The basic greedy diff algorithm. Currently, this is the default.
`minimal`;;
	Spend extra time to make sure the smallest possible diff is
	produced.
`patience`;;
	Use "patience diff" algorithm when generating patches.
`histogram`;;
	This algorithm extends the patience algorithm to "support
	low-occurrence common elements".
--
+

`diff.wsErrorHighlight`::
	Highlight whitespace errors in the `context`, `old` or `new`
	lines of the diff.  Multiple values are separated by comma,
	`none` resets previous values, `default` reset the list to
	`new` and `all` is a shorthand for `old,new,context`.  The
	whitespace errors are colored with `color.diff.whitespace`.
	The command line option `--ws-error-highlight=<kind>`
	overrides this setting.

`diff.colorMoved`::
	If set to either a valid _<mode>_ or a `true` value, moved lines
	in a diff are colored differently.
ifdef::git-diff[]
	For details of valid modes see `--color-moved`.
endif::git-diff[]
ifndef::git-diff[]
	For details of valid modes see `--color-moved` in linkgit:git-diff[1].
endif::git-diff[]
	If simply set to `true` the default color mode will be used. When
	set to `false`, moved lines are not colored.

`diff.colorMovedWS`::
	When moved lines are colored using e.g. the `diff.colorMoved` setting,
	this option controls the mode how spaces are treated.
	For details of valid modes see `--color-moved-ws` in linkgit:git-diff[1].

Title: Git Diff Configuration Options for Customization
Summary
This section describes various configuration options for customizing Git's diff behavior, including word regex, custom diff drivers, diff algorithms, whitespace error highlighting, and color settings for moved lines, allowing for fine-grained control over the diff output.