author | Johannes Schindelin <johannes.schindelin@gmx.de> | |
Sat, 17 Jan 2009 16:29:45 +0000 (17:29 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 17 Jan 2009 18:43:08 +0000 (10:43 -0800) | ||
commit | 2b6a5417d750d086d1da906e46de2b3ad8df6753 | |
tree | 46d5ccf880314ecba51547d89a75304393b3a62d | tree | snapshot |
parent | 2e5d2003b28820f88296e47a79eb440ca0295000 | commit | diff |
color-words: take an optional regular expression describing words
In some applications, words are not delimited by white space. To
allow for that, you can specify a regular expression describing
what makes a word with
git diff --color-words='[A-Za-z0-9]+'
Note that words cannot contain newline characters.
As suggested by Thomas Rast, the words are the exact matches of the
regular expression.
Note that a regular expression beginning with a '^' will match only
a word at the beginning of the hunk, not a word at the beginning of
a line, and is probably not what you want.
This commit contains a quoting fix by Thomas Rast.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
In some applications, words are not delimited by white space. To
allow for that, you can specify a regular expression describing
what makes a word with
git diff --color-words='[A-Za-z0-9]+'
Note that words cannot contain newline characters.
As suggested by Thomas Rast, the words are the exact matches of the
regular expression.
Note that a regular expression beginning with a '^' will match only
a word at the beginning of the hunk, not a word at the beginning of
a line, and is probably not what you want.
This commit contains a quoting fix by Thomas Rast.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/diff-options.txt | diff | blob | history | |
diff.c | diff | blob | history | |
diff.h | diff | blob | history | |
t/t4034-diff-words.sh | diff | blob | history |