summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 98a4d87)
raw | patch | inline | side by side (parent: 98a4d87)
author | Boyd Stephen Smith Jr <bss@iguanasuicide.net> | |
Wed, 21 Jan 2009 04:59:54 +0000 (22:59 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 22 Jan 2009 07:52:16 +0000 (23:52 -0800) |
Use "wordRegex" for configuration variable names. Use "word_regex" for C
language tokens.
Signed-off-by: Boyd Stephen Smith Jr. <bss@iguanasuicide.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
language tokens.
Signed-off-by: Boyd Stephen Smith Jr. <bss@iguanasuicide.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt | patch | blob | history | |
Documentation/gitattributes.txt | patch | blob | history | |
t/t4034-diff-words.sh | patch | blob | history | |
userdiff.c | patch | blob | history |
index 0ca983ac3b36465cd63ba55ea702ec1aba9ea445..332213e65d0f4972906f6804d4994842a1d7f6f3 100644 (file)
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
A boolean to inhibit the standard behavior of printing a space
before each empty output line. Defaults to false.
-diff.wordregex::
+diff.wordRegex::
A POSIX Extended Regular Expression used to determine what is a "word"
when performing word-by-word difference calculations. Character
sequences that match the regular expression are "words", all other
index ba3ba12730a3c4ef1c7651d5f86645a8db98b79f..227934f59adc42e347cdf4698586d4bca26ca6a3 100644 (file)
You can customize the rules that `git diff --color-words` uses to
split words in a line, by specifying an appropriate regular expression
-in the "diff.*.wordregex" configuration variable. For example, in TeX
+in the "diff.*.wordRegex" configuration variable. For example, in TeX
a backslash followed by a sequence of letters forms a command, but
several such commands can be run together without intervening
whitespace. To separate them, use a regular expression such as
------------------------
[diff "tex"]
- wordregex = "\\\\[a-zA-Z]+|[{}]|\\\\.|[^\\{}[:space:]]+"
+ wordRegex = "\\\\[a-zA-Z]+|[{}]|\\\\.|[^\\{}[:space:]]+"
------------------------
A built-in pattern is provided for all languages listed in the
diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh
index 6bcc1530845e94a9251710a7fc7c8790da52020d..4508effcaacd3dbc8fadb13c7be0d631f4c946f1 100755 (executable)
--- a/t/t4034-diff-words.sh
+++ b/t/t4034-diff-words.sh
'
test_expect_success 'set a diff driver' '
- git config diff.testdriver.wordregex "[^[:space:]]" &&
+ git config diff.testdriver.wordRegex "[^[:space:]]" &&
cat <<EOF > .gitattributes
pre diff=testdriver
post diff=testdriver
'
-test_expect_success 'set diff.wordregex option' '
- git config diff.wordregex "[[:alnum:]]+"
+test_expect_success 'set diff.wordRegex option' '
+ git config diff.wordRegex "[[:alnum:]]+"
'
cp expect.letter-runs-are-words expect
'
test_expect_success 'remove diff driver regex' '
- git config --unset diff.testdriver.wordregex
+ git config --unset diff.testdriver.wordRegex
'
cat > expect <<\EOF
diff --git a/userdiff.c b/userdiff.c
index 2b555094856ec9eeb95d9fbb6fcbb48de209525c..d556da975197a718979575864e37c2b9b9f3327a 100644 (file)
--- a/userdiff.c
+++ b/userdiff.c
static int ndrivers;
static int drivers_alloc;
-#define PATTERNS(name, pattern, wordregex) \
- { name, NULL, -1, { pattern, REG_EXTENDED }, wordregex }
+#define PATTERNS(name, pattern, word_regex) \
+ { name, NULL, -1, { pattern, REG_EXTENDED }, word_regex }
static struct userdiff_driver builtin_drivers[] = {
PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$",
"[^<>= \t]+|[^[:space:]]|[\x80-\xff]+"),