Skip to content

Commit c4b252c

Browse files
trastgitster
authored andcommitted
color-words: expand docs with precise semantics
Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent bf82940 commit c4b252c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Documentation/diff-options.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,17 @@ endif::git-format-patch[]
9191
Turn off colored diff, even when the configuration file
9292
gives the default to color output.
9393

94-
--color-words[=regex]::
95-
Show colored word diff, i.e. color words which have changed.
94+
--color-words[=<regex>]::
95+
Show colored word diff, i.e., color words which have changed.
96+
By default, words are separated by whitespace.
9697
+
97-
Optionally, you can pass a regular expression that tells Git what the
98-
words are that you are looking for; The default is to interpret any
99-
stretch of non-whitespace as a word.
98+
When a <regex> is specified, every non-overlapping match of the
99+
<regex> is considered a word. Anything between these matches is
100+
considered whitespace and ignored(!) for the purposes of finding
101+
differences. You may want to append `|[^[:space:]]` to your regular
102+
expression to make sure that it matches all non-whitespace characters.
103+
A match that contains a newline is silently truncated(!) at the
104+
newline.
100105

101106
--no-renames::
102107
Turn off rename detection, even when the configuration

0 commit comments

Comments
 (0)