diff options
Diffstat (limited to 'Documentation/diff-options.adoc')
| -rw-r--r-- | Documentation/diff-options.adoc | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc index ae31520f7f..8a63b5e164 100644 --- a/Documentation/diff-options.adoc +++ b/Documentation/diff-options.adoc @@ -127,8 +127,10 @@ endif::git-log[] `-U<n>`:: `--unified=<n>`:: - Generate diffs with _<n>_ lines of context instead of - the usual three. + Generate diffs with _<n>_ lines of context. The number of context + lines defaults to `diff.context` or 3 if the configuration variable + is unset. (`-U` without `<n>` is silently accepted as a synonym for + `-p` due to a historical accident). ifndef::git-format-patch[] Implies `--patch`. endif::git-format-patch[] @@ -197,26 +199,7 @@ and starts with _<text>_, this algorithm attempts to prevent it from appearing as a deletion or addition in the output. It uses the "patience diff" algorithm internally. -`--diff-algorithm=(patience|minimal|histogram|myers)`:: - 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". --- -+ -For instance, if you configured the `diff.algorithm` variable to a -non-default value and want to use the default one, then you -have to use `--diff-algorithm=default` option. +include::diff-algorithm-option.adoc[] `--stat[=<width>[,<name-width>[,<count>]]]`:: Generate a diffstat. By default, as much space as necessary @@ -878,10 +861,18 @@ endif::git-format-patch[] Do not show any source or destination prefix. `--default-prefix`:: +ifdef::git-format-patch[] + Use the default source and destination prefixes ("a/" and "b/"). + This overrides configuration variables such as `format.noprefix`, + `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` + (see linkgit:git-config[1]). +endif::git-format-patch[] +ifndef::git-format-patch[] Use the default source and destination prefixes ("a/" and "b/"). This overrides configuration variables such as `diff.noprefix`, `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` (see linkgit:git-config[1]). +endif::git-format-patch[] `--line-prefix=<prefix>`:: Prepend an additional _<prefix>_ to every line of output. |
