summaryrefslogtreecommitdiff
path: root/Documentation/diff-options.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/diff-options.txt')
-rw-r--r--Documentation/diff-options.txt49
1 files changed, 42 insertions, 7 deletions
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 8707d0e..0d89aaa 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -21,6 +21,7 @@ endif::git-format-patch[]
ifndef::git-format-patch[]
-p::
-u::
+--patch::
Generate patch (see section on generating patches).
{git-diff? This is the default.}
endif::git-format-patch[]
@@ -94,8 +95,8 @@ Also, when `--raw` or `--numstat` has been given, do not munge
pathnames and use NULs as output field terminators.
endif::git-log[]
ifndef::git-log[]
- When `--raw` or `--numstat` has been given, do not munge
- pathnames and use NULs as output field terminators.
+ 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, each pathname output will have TAB, LF, double quotes,
@@ -117,18 +118,48 @@ any of those replacements occurred.
option and lists the commits in that commit range like the 'summary'
option of linkgit:git-submodule[1] does.
---color::
+--color[=<when>]::
Show colored diff.
+ The value must be always (the default), never, or auto.
--no-color::
Turn off colored diff, even when the configuration file
gives the default to color output.
+ Same as `--color=never`.
---color-words[=<regex>]::
- Show colored word diff, i.e., color words which have changed.
- By default, words are separated by whitespace.
+--word-diff[=<mode>]::
+ Show a word diff, using the <mode> to delimit changed words.
+ By default, words are delimited by whitespace; see
+ `--word-diff-regex` below. The <mode> defaults to 'plain', and
+ must be one of:
++
+--
+color::
+ Highlight changed words using only colors. Implies `--color`.
+plain::
+ Show words as `[-removed-]` and `{+added+}`. Makes no
+ attempts to escape the delimiters if they appear in the input,
+ so the output may be ambiguous.
+porcelain::
+ Use a special line-based format intended for script
+ consumption. Added/removed/unchanged runs are printed in the
+ usual unified diff format, starting with a `+`/`-`/` `
+ character at the beginning of the line and extending to the
+ end of the line. Newlines in the input are represented by a
+ tilde `~` on a line of its own.
+none::
+ Disable word diff again.
+--
++
+Note that despite the name of the first mode, color is used to
+highlight the changed parts in all modes if enabled.
+
+--word-diff-regex=<regex>::
+ Use <regex> to decide what a word is, instead of considering
+ runs of non-whitespace to be a word. Also implies
+ `--word-diff` unless it was already enabled.
+
-When a <regex> is specified, every non-overlapping match of the
+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
@@ -140,6 +171,10 @@ 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.
+
+--color-words[=<regex>]::
+ Equivalent to `--word-diff=color` plus (if a regex was
+ specified) `--word-diff-regex=<regex>`.
endif::git-format-patch[]
--no-renames::