summaryrefslogtreecommitdiff
path: root/t/t4034-diff-words.sh
diff options
context:
space:
mode:
authorWilliam Duclot <william.duclot@ensimag.grenoble-inp.fr>2016-06-03 12:32:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-06-03 21:45:56 (GMT)
commit0719f3eecd1234f6331cab980088239207e93335 (patch)
treebb3a1a01ac9412ef6c35bf8337b278a221e96f14 /t/t4034-diff-words.sh
parent4b0891ffe4ec3aef081cf48c5f9a747586076f7a (diff)
downloadgit-0719f3eecd1234f6331cab980088239207e93335.zip
git-0719f3eecd1234f6331cab980088239207e93335.tar.gz
git-0719f3eecd1234f6331cab980088239207e93335.tar.bz2
userdiff: add built-in pattern for CSS
CSS is widely used, motivating it being included as a built-in pattern. It must be noted that the word_regex for CSS (i.e. the regex defining what is a word in the language) does not consider '.' and '#' characters (in CSS selectors) to be part of the word. This behavior is documented by the test t/t4018/css-rule. The logic behind this behavior is the following: identifiers in CSS selectors are identifiers in a HTML/XML document. Therefore, the '.'/'#' character are not part of the identifier, but an indicator of the nature of the identifier in HTML/XML (class or id). Diffing ".class1" and ".class2" must show that the class name is changed, but we still are selecting a class. Logic behind the "pattern" regex is: 1. reject lines ending with a colon/semicolon (properties) 2. if a line begins with a name in column 1, pick the whole line Credits to Johannes Sixt (j6t@kdbg.org) for the pattern regex and most of the tests. Signed-off-by: William Duclot <william.duclot@ensimag.grenoble-inp.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Reviewed-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4034-diff-words.sh')
-rwxr-xr-xt/t4034-diff-words.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh
index f2f55fc..912df91 100755
--- a/t/t4034-diff-words.sh
+++ b/t/t4034-diff-words.sh
@@ -302,6 +302,7 @@ test_language_driver ada
test_language_driver bibtex
test_language_driver cpp
test_language_driver csharp
+test_language_driver css
test_language_driver fortran
test_language_driver html
test_language_driver java