@@ -127,11 +127,39 @@ any of those replacements occurred.
127127 gives the default to color output.
128128 Same as `--color=never`.
129129
130- --color-words[=<regex>]::
131- Show colored word diff, i.e., color words which have changed.
132- By default, words are separated by whitespace.
130+ --word-diff[=<mode>]::
131+ Show a word diff, using the <mode> to delimit changed words.
132+ By default, words are delimited by whitespace; see
133+ `--word-diff-regex` below. The <mode> defaults to 'plain', and
134+ must be one of:
135+ +
136+ --
137+ color::
138+ Highlight changed words using only colors. Implies `--color`.
139+ plain::
140+ Show words as `[-removed-]` and `{+added+}`. Makes no
141+ attempts to escape the delimiters if they appear in the input,
142+ so the output may be ambiguous.
143+ porcelain::
144+ Use a special line-based format intended for script
145+ consumption. Added/removed/unchanged runs are printed in the
146+ usual unified diff format, starting with a `+`/`-`/` `
147+ character at the beginning of the line and extending to the
148+ end of the line. Newlines in the input are represented by a
149+ tilde `~` on a line of its own.
150+ none::
151+ Disable word diff again.
152+ --
153+ +
154+ Note that despite the name of the first mode, color is used to
155+ highlight the changed parts in all modes if enabled.
156+
157+ --word-diff-regex=<regex>::
158+ Use <regex> to decide what a word is, instead of considering
159+ runs of non-whitespace to be a word. Also implies
160+ `--word-diff` unless it was already enabled.
133161+
134- When a <regex> is specified, every non-overlapping match of the
162+ Every non-overlapping match of the
135163<regex> is considered a word. Anything between these matches is
136164considered whitespace and ignored(!) for the purposes of finding
137165differences. You may want to append `|[^[:space:]]` to your regular
@@ -143,6 +171,10 @@ The regex can also be set via a diff driver or configuration option, see
143171linkgit:gitattributes[1] or linkgit:git-config[1]. Giving it explicitly
144172overrides any diff driver or configuration setting. Diff drivers
145173override configuration settings.
174+
175+ --color-words[=<regex>]::
176+ Equivalent to `--word-diff=color` plus (if a regex was
177+ specified) `--word-diff-regex=<regex>`.
146178endif::git-format-patch[]
147179
148180--no-renames::
0 commit comments