Code

Documentation/git-archive.txt: Note attributes
[git.git] / Documentation / diff-options.txt
index 572154834b35675ccf56920efd540bf872d1ab25..813a7b11b99d51d3014f854770384ed4fc247c9f 100644 (file)
@@ -19,16 +19,12 @@ endif::git-format-patch[]
 
 ifndef::git-format-patch[]
 -p::
+-u::
        Generate patch (see section on generating patches).
        {git-diff? This is the default.}
 endif::git-format-patch[]
 
--u::
-       Synonym for "-p".
-
 -U<n>::
-       Shorthand for "--unified=<n>".
-
 --unified=<n>::
        Generate diffs with <n> lines of context instead of
        the usual three. Implies "-p".
@@ -40,6 +36,9 @@ endif::git-format-patch[]
 --patch-with-raw::
        Synonym for "-p --raw".
 
+--patience::
+       Generate a diff using the "patience diff" algorithm.
+
 --stat[=width[,name-width]]::
        Generate a diffstat.  You can override the default
        output width for 80-column terminal by "--stat=width".
@@ -59,12 +58,14 @@ endif::git-format-patch[]
        lines.
 
 --dirstat[=limit]::
-       Output only the sub-directories that are impacted by a diff,
-       and to what degree they are impacted.  You can override the
-       default cut-off in percent (3) by "--dirstat=limit".  If you
-       want to enable "cumulative" directory statistics, you can use
-       the "--cumulative" flag, which adds up percentages recursively
-       even when they have been already reported for a sub-directory.
+       Output the distribution of relative amount of changes (number of lines added or
+       removed) for each sub-directory. Directories with changes below
+       a cut-off percent (3% by default) are not shown. The cut-off percent
+       can be set with "--dirstat=limit". Changes in a child directory is not
+       counted for the parent directory, unless "--cumulative" is used.
+
+--dirstat-by-file[=limit]::
+       Same as --dirstat, but counts changed files instead of lines.
 
 --summary::
        Output a condensed summary of extended header information
@@ -93,8 +94,22 @@ endif::git-format-patch[]
        Turn off colored diff, even when the configuration file
        gives the default to color output.
 
---color-words::
-       Show colored word diff, i.e. color words which have changed.
+--color-words[=<regex>]::
+       Show colored word diff, i.e., color words which have changed.
+       By default, words are separated by whitespace.
++
+When a <regex> is specified, every non-overlapping match of the
+<regex> is considered a word.  Anything between these matches is
+considered whitespace and ignored(!) for the purposes of finding
+differences.  You may want to append `|[^[:space:]]` to your regular
+expression to make sure that it matches all non-whitespace characters.
+A match that contains a newline is silently truncated(!) at the
+newline.
++
+The regex can also be set via a diff driver or configuration option, see
+linkgit:gitattributes[1] or linkgit:git-config[1].  Giving it explicitly
+overrides any diff driver or configuration setting.  Diff drivers
+override configuration settings.
 
 --no-renames::
        Turn off rename detection, even when the configuration
@@ -107,9 +122,9 @@ endif::git-format-patch[]
        --exit-code.
 
 --full-index::
-       Instead of the first handful characters, show full
-       object name of pre- and post-image blob on the "index"
-       line when generating patch format output.
+       Instead of the first handful of characters, show the full
+       pre- and post-image blob object names on the "index"
+       line when generating patch format output.
 
 --binary::
        In addition to --full-index, output "binary diff" that
@@ -118,7 +133,7 @@ endif::git-format-patch[]
 --abbrev[=<n>]::
        Instead of showing the full 40-byte hexadecimal object
        name in diff-raw format output and diff-tree header
-       lines, show only handful hexdigits prefix.  This is
+       lines, show only a partial prefix.  This is
        independent of --full-index option above, which controls
        the diff-patch output format.  Non default number of
        digits can be specified with --abbrev=<n>.
@@ -135,7 +150,8 @@ endif::git-format-patch[]
 --diff-filter=[ACDMRTUXB*]::
        Select only files that are Added (`A`), Copied (`C`),
        Deleted (`D`), Modified (`M`), Renamed (`R`), have their
-       type (mode) changed (`T`), are Unmerged (`U`), are
+       type (i.e. regular file, symlink, submodule, ...) changed (`T`),
+       are Unmerged (`U`), are
        Unknown (`X`), or have had their pairing Broken (`B`).
        Any combination of the filter characters may be used.
        When `*` (All-or-none) is added to the combination, all
@@ -187,30 +203,28 @@ endif::git-format-patch[]
        can name which subdirectory to make the output relative
        to by giving a <path> as an argument.
 
+-a::
 --text::
        Treat all files as text.
 
--a::
-       Shorthand for "--text".
-
 --ignore-space-at-eol::
        Ignore changes in whitespace at EOL.
 
+-b::
 --ignore-space-change::
        Ignore changes in amount of whitespace.  This ignores whitespace
        at line end, and considers all other sequences of one or
        more whitespace characters to be equivalent.
 
--b::
-       Shorthand for "--ignore-space-change".
-
+-w::
 --ignore-all-space::
        Ignore whitespace when comparing lines.  This ignores
        differences even if one line has whitespace where the other
        line has none.
 
--w::
-       Shorthand for "--ignore-all-space".
+--inter-hunk-context=<lines>::
+       Show the context between diff hunks, up to the specified number
+       of lines, thereby fusing hunks that are close to each other.
 
 --exit-code::
        Make the program exit with codes similar to diff(1).
@@ -241,4 +255,4 @@ endif::git-format-patch[]
        Do not show any source or destination prefix.
 
 For more detailed explanation on these common options, see also
-linkgit:gitdiffcore[7][diffcore documentation].
+linkgit:gitdiffcore[7].