Home Explore Blog CI



git

4th chunk of `Documentation/diff-options.adoc`
8de2030d3d186cf22b5193132c8cfc2a6ca5af845b49d0170000000100000fa6
 This is a more expensive `--dirstat`
	behavior than the `changes` 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 `--*stat` options.
`files`;;
	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 `--dirstat` behavior, since it does
	not have to look at the file contents at all.
`cumulative`;;
	Count changes in a child directory for the parent directory as well.
	Note that when using `cumulative`, the sum of the percentages
	reported may exceed 100%. The default (non-cumulative) behavior can
	be specified with the `noncumulative` parameter.
_<limit>_;;
	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.
--
+
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:
`--dirstat=files,10,cumulative`.

`--cumulative`::
	Synonym for `--dirstat=cumulative`.

`--dirstat-by-file[=<param>,...]`::
	Synonym for `--dirstat=files,<param>,...`.

`--summary`::
	Output a condensed summary of extended header information
	such as creations, renames and mode changes.

ifndef::git-format-patch[]
`--patch-with-stat`::
	Synonym for `-p --stat`.
endif::git-format-patch[]

ifndef::git-format-patch[]

`-z`::
ifdef::git-log[]
	Separate the commits with __NUL__s instead of newlines.
+
Also, when `--raw` or `--numstat` has been given, do not munge
pathnames and use __NUL__s as output field terminators.
endif::git-log[]
ifndef::git-log[]
	When `--raw`, `--numstat`, `--name-only` or `--name-status` has been
	given, do not munge pathnames and use NULs as output field terminators.
endif::git-log[]
+
Without this option, pathnames with "unusual" characters are quoted as
explained for the configuration variable `core.quotePath` (see
linkgit:git-config[1]).

`--name-only`::
	Show only the name of each changed file in the post-image tree.
	The file names are often encoded in UTF-8.
	For more information see the discussion about encoding in the linkgit:git-log[1]
	manual page.

`--name-status`::
	Show only the name(s) and status of each changed file. See the description
	of the `--diff-filter` option on what the status letters mean.
	Just like `--name-only` the file names are often encoded in UTF-8.

`--submodule[=<format>]`::
	Specify how differences in submodules are shown.  When specifying
	`--submodule=short` the `short` format is used.  This format just
	shows the names of the commits at the beginning and end of the range.
	When `--submodule` or `--submodule=log` is specified, the `log`
	format is used.  This format lists the commits in the range like
	linkgit:git-submodule[1] `summary` does.  When `--submodule=diff`
	is specified, the `diff` format is used.  This format shows an
	inline diff of the changes in the submodule contents between the
	commit range.  Defaults to `diff.submodule` or the `short` format
	if the config option is unset.

`--color[=<when>]`::
	Show colored diff.
	`--color` (i.e. without `=<when>`) is the same as `--color=always`.
	_<when>_ can be one of `always`, `never`, or `auto`.
ifdef::git-diff[]
	It can be changed by the `color.ui` and `color.diff`
	configuration settings.
endif::git-diff[]

`--no-color`::
	Turn off colored diff.
ifdef::git-diff[]
	This can be used to override configuration settings.
endif::git-diff[]
	It is the same as `--color=never`.

`--color-moved[=<mode>]`::
	Moved lines of code are colored differently.
ifdef::git-diff[]
	It can be changed by the `diff.colorMoved` configuration setting.
endif::git-diff[]
	The _<mode>_ defaults to `no` if the option is not given
	and to `zebra` if the option with no mode is given.
	The mode must be one of:
+
--
`no`::

Title: Git Diff Options
Summary
This section describes various options for customizing the output of Git diff commands, including options for displaying statistics, counting changes, and controlling the display of diff information, as well as options for customizing the display of submodule information, color output, and moved lines of code.