{"thread":{"id":"42398","subject":"[PATCH] userdiff: add built-in pattern for CSS","startedAt":"2016-05-20T13:28:29Z","lastAt":"2016-06-06T20:55:49Z","messageCount":21,"participants":["William Duclot","Junio C Hamano","Johannes Sixt","Matthieu Moy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"287085","messageId":"20160520132829.7937-1-william.duclot@ensimag.grenoble-inp.fr","threadId":"42398","inReplyTo":null,"subject":"[PATCH] userdiff: add built-in pattern for CSS","fromName":"William Duclot","fromEmail":"william.duclot@ensimag.grenoble-inp.fr","sentAt":"2016-05-20T13:28:29Z","receivedAt":"2016-05-20T13:28:29Z","isPatch":true,"sender":{"key":"william.duclot@ensimag.grenoble-inp.fr","avatar":null},"body":"CSS is widely used, motivating it being included as a built-in pattern.\n\nIt must be noted that the word_regex for CSS (i.e. the regex defining\nwhat is a word in the language) does not consider '.' and '#' characters\n(in CSS selectors) to be part of the word. This behavior is documented\nby the test t/t4018/css-rule.\nThe logic behind this behavior is the following: identifiers in CSS\nselectors are identifiers in a HTML/XML document. Therefore, the '.'/'#'\ncharacter are not part of the identifier, but an indicator of the nature\nof the identifier in HTML/XML (class or id). Diffing \".class1\" and\n\".class2\" must show that the class name is changed, but we still are\nselecting a class.\n\nSigned-off-by: William Duclot <william.duclot@ensimag.grenoble-inp.fr>\nSigned-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>\n---\n Documentation/gitattributes.txt |  2 ++\n t/t4018-diff-funcname.sh        |  1 +\n t/t4018/css-rule                |  4 ++++\n t/t4034-diff-words.sh           |  1 +\n t/t4034/css/expect              | 16 ++++++++++++++++\n t/t4034/css/post                |  9 +++++++++\n t/t4034/css/pre                 |  9 +++++++++\n userdiff.c                      |  8 ++++++++\n 8 files changed, 50 insertions(+)\n create mode 100644 t/t4018/css-rule\n create mode 100644 t/t4034/css/expect\n create mode 100644 t/t4034/css/post\n create mode 100644 t/t4034/css/pre\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex e3b1de8..81f60ad 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -525,6 +525,8 @@ patterns are available:\n \n - `csharp` suitable for source code in the C# language.\n \n+- `css` suitable for source code in the CSS language.\n+\n - `fortran` suitable for source code in the Fortran language.\n \n - `fountain` suitable for Fountain documents.\ndiff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh\nindex 67373dc..1795ffc 100755\n--- a/t/t4018-diff-funcname.sh\n+++ b/t/t4018-diff-funcname.sh\n@@ -30,6 +30,7 @@ diffpatterns=\"\n \tbibtex\n \tcpp\n \tcsharp\n+\tcss\n \tfortran\n \tfountain\n \thtml\ndiff --git a/t/t4018/css-rule b/t/t4018/css-rule\nnew file mode 100644\nindex 0000000..84ed754\n--- /dev/null\n+++ b/t/t4018/css-rule\n@@ -0,0 +1,4 @@\n+RIGHT label.control-label {\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh\nindex f2f55fc..912df91 100755\n--- a/t/t4034-diff-words.sh\n+++ b/t/t4034-diff-words.sh\n@@ -302,6 +302,7 @@ test_language_driver ada\n test_language_driver bibtex\n test_language_driver cpp\n test_language_driver csharp\n+test_language_driver css\n test_language_driver fortran\n test_language_driver html\n test_language_driver java\ndiff --git a/t/t4034/css/expect b/t/t4034/css/expect\nnew file mode 100644\nindex 0000000..b025d88\n--- /dev/null\n+++ b/t/t4034/css/expect\n@@ -0,0 +1,16 @@\n+<BOLD>diff --git a/pre b/post<RESET>\n+<BOLD>index 735f301..bdf6a90 100644<RESET>\n+<BOLD>--- a/pre<RESET>\n+<BOLD>+++ b/post<RESET>\n+<CYAN>@@ -1,9 +1,9 @@<RESET>\n+.<RED>class-form<RESET><GREEN>other-form<RESET> label.control-label {\n+    margin-top: <RED>10<RESET><GREEN>15<RESET>px!important;\n+    border : 10px <RED>dashed<RESET><GREEN>dotted<RESET> #C6C6C6;\n+}<RESET>\n+<RED>#CCCCCC<RESET>\n+<RED>padding-bottom<RESET><GREEN>#CCCCCB<RESET>\n+<GREEN>margin-left<RESET>\n+150<RED>px<RESET><GREEN>em<RESET>\n+10px\n+<RED>!important<RESET>\n+<RED>div<RESET><GREEN>li<RESET>.class#id\ndiff --git a/t/t4034/css/post b/t/t4034/css/post\nnew file mode 100644\nindex 0000000..bdf6a90\n--- /dev/null\n+++ b/t/t4034/css/post\n@@ -0,0 +1,9 @@\n+.other-form label.control-label {\n+    margin-top: 15px!important;\n+    border : 10px dotted #C6C6C6;\n+}\n+#CCCCCB\n+margin-left\n+150em\n+10px\n+li.class#id\ndiff --git a/t/t4034/css/pre b/t/t4034/css/pre\nnew file mode 100644\nindex 0000000..735f301\n--- /dev/null\n+++ b/t/t4034/css/pre\n@@ -0,0 +1,9 @@\n+.class-form label.control-label {\n+    margin-top: 10px!important;\n+    border : 10px dashed #C6C6C6;\n+}\n+#CCCCCC\n+padding-bottom\n+150px\n+10px!important\n+div.class#id\ndiff --git a/userdiff.c b/userdiff.c\nindex 6bf2505..0f9cfbe 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -148,6 +148,14 @@ PATTERNS(\"csharp\",\n \t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n \t \"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?\"\n \t \"|[-+*/<>%&^|=!]=|--|\\\\+\\\\+|<<=?|>>=?|&&|\\\\|\\\\||::|->\"),\n+PATTERNS(\"css\",\n+\t \"^([^,{}]+)((,[^}]*\\\\{)|([ \\t]*\\\\{))$\",\n+\t /* -- */\n+\t /* This regex comes from W3C CSS specs. Should theoretically also allow ISO 10646 characters U+00A0 and higher,\n+\t  * this not handled in this regex. */\n+\t \"-?[_a-zA-F][-_a-zA-F0-9]*\" /* identifiers */\n+\t \"|-?[0-9]+|\\\\#[0-9a-fA-F]+\" /* numbers */\n+),\n { \"default\", NULL, -1, { NULL, 0 } },\n };\n #undef PATTERNS\n-- \n2.8.2.403.gdf0b511.dirty\n"},{"id":"287140","messageId":"xmqqshxcbbkp.fsf@gitster.mtv.corp.google.com","threadId":"42398","inReplyTo":"20160520132829.7937-1-william.duclot@ensimag.grenoble-inp.fr","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-20T22:37:26Z","receivedAt":"2016-05-20T22:37:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:\n\n> CSS is widely used, motivating it being included as a built-in pattern.\n>\n> It must be noted that the word_regex for CSS (i.e. the regex defining\n> what is a word in the language) does not consider '.' and '#' characters\n> (in CSS selectors) to be part of the word. This behavior is documented\n> by the test t/t4018/css-rule.\n> The logic behind this behavior is the following: identifiers in CSS\n> selectors are identifiers in a HTML/XML document. Therefore, the '.'/'#'\n> character are not part of the identifier, but an indicator of the nature\n> of the identifier in HTML/XML (class or id). Diffing \".class1\" and\n> \".class2\" must show that the class name is changed, but we still are\n> selecting a class.\n\nIn other words, if \"div#foo\" changed to \"span#bar\", word-diff would\nsay that \"div changed to span, # didn't change and foo changed to\nbar\".\n\nWhich makes sense to me.\n\nThe above is not a request to change anything; just me thinking\naloud to see if I agree with the reasoning.\n\n> diff --git a/userdiff.c b/userdiff.c\n> index 6bf2505..0f9cfbe 100644\n> --- a/userdiff.c\n> +++ b/userdiff.c\n> @@ -148,6 +148,14 @@ PATTERNS(\"csharp\",\n>  \t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n>  \t \"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?\"\n>  \t \"|[-+*/<>%&^|=!]=|--|\\\\+\\\\+|<<=?|>>=?|&&|\\\\|\\\\||::|->\"),\n> +PATTERNS(\"css\",\n> +\t \"^([^,{}]+)((,[^}]*\\\\{)|([ \\t]*\\\\{))$\",\n> +\t /* -- */\n> +\t /* This regex comes from W3C CSS specs. Should theoretically also allow ISO 10646 characters U+00A0 and higher,\n> +\t  * this not handled in this regex. */\n> +\t \"-?[_a-zA-F][-_a-zA-F0-9]*\" /* identifiers */\n> +\t \"|-?[0-9]+|\\\\#[0-9a-fA-F]+\" /* numbers */\n> +),\n\nStyle:\n\n\t/*\n         * This regex comes from ...\n         * ...\n         * but they are not handled with this regex.\n         */\n\nI wonder if IPATTERN() may make it easier to express the above.\n\nAlso, a-zA-F (twice seen in \"identifiers\" section) looks somewhat\nsuspicious.  a-fA-F or a-zA-Z I would understand, and I suspect this\nis a misspelled form of the latter.\n"},{"id":"287416","messageId":"20160524142537.19324-1-william.duclot@ensimag.grenoble-inp.fr","threadId":"42398","inReplyTo":"20160520132829.7937-1-william.duclot@ensimag.grenoble-inp.fr","subject":"[PATCH] userdiff: add built-in pattern for CSS","fromName":"William Duclot","fromEmail":"william.duclot@ensimag.grenoble-inp.fr","sentAt":"2016-05-24T14:25:37Z","receivedAt":"2016-05-24T14:25:37Z","isPatch":true,"sender":{"key":"william.duclot@ensimag.grenoble-inp.fr","avatar":null},"body":"CSS is widely used, motivating it being included as a built-in pattern.\n\nIt must be noted that the word_regex for CSS (i.e. the regex defining\nwhat is a word in the language) does not consider '.' and '#' characters\n(in CSS selectors) to be part of the word. This behavior is documented\nby the test t/t4018/css-rule.\nThe logic behind this behavior is the following: identifiers in CSS\nselectors are identifiers in a HTML/XML document. Therefore, the '.'/'#'\ncharacter are not part of the identifier, but an indicator of the nature\nof the identifier in HTML/XML (class or id). Diffing \".class1\" and\n\".class2\" must show that the class name is changed, but we still are\nselecting a class.\n\nSigned-off-by: William Duclot <william.duclot@ensimag.grenoble-inp.fr>\nSigned-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>\n---\nchanges since v1:\nFix a typo in the word_regex (\"A-F\" => \"A-Z\").\nClearer comment about ISO 10646 characters.\n\n Documentation/gitattributes.txt |  2 ++\n t/t4018-diff-funcname.sh        |  1 +\n t/t4018/css-rule                |  4 ++++\n t/t4034-diff-words.sh           |  1 +\n t/t4034/css/expect              | 16 ++++++++++++++++\n t/t4034/css/post                | 10 ++++++++++\n t/t4034/css/pre                 | 10 ++++++++++\n userdiff.c                      |  8 ++++++++\n 8 files changed, 52 insertions(+)\n create mode 100644 t/t4018/css-rule\n create mode 100644 t/t4034/css/expect\n create mode 100644 t/t4034/css/post\n create mode 100644 t/t4034/css/pre\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex e3b1de8..81f60ad 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -525,6 +525,8 @@ patterns are available:\n \n - `csharp` suitable for source code in the C# language.\n \n+- `css` suitable for source code in the CSS language.\n+\n - `fortran` suitable for source code in the Fortran language.\n \n - `fountain` suitable for Fountain documents.\ndiff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh\nindex 67373dc..1795ffc 100755\n--- a/t/t4018-diff-funcname.sh\n+++ b/t/t4018-diff-funcname.sh\n@@ -30,6 +30,7 @@ diffpatterns=\"\n \tbibtex\n \tcpp\n \tcsharp\n+\tcss\n \tfortran\n \tfountain\n \thtml\ndiff --git a/t/t4018/css-rule b/t/t4018/css-rule\nnew file mode 100644\nindex 0000000..84ed754\n--- /dev/null\n+++ b/t/t4018/css-rule\n@@ -0,0 +1,4 @@\n+RIGHT label.control-label {\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh\nindex f2f55fc..912df91 100755\n--- a/t/t4034-diff-words.sh\n+++ b/t/t4034-diff-words.sh\n@@ -302,6 +302,7 @@ test_language_driver ada\n test_language_driver bibtex\n test_language_driver cpp\n test_language_driver csharp\n+test_language_driver css\n test_language_driver fortran\n test_language_driver html\n test_language_driver java\ndiff --git a/t/t4034/css/expect b/t/t4034/css/expect\nnew file mode 100644\nindex 0000000..ed10393\n--- /dev/null\n+++ b/t/t4034/css/expect\n@@ -0,0 +1,16 @@\n+<BOLD>diff --git a/pre b/post<RESET>\n+<BOLD>index b8ae0bb..fe500b7 100644<RESET>\n+<BOLD>--- a/pre<RESET>\n+<BOLD>+++ b/post<RESET>\n+<CYAN>@@ -1,10 +1,10 @@<RESET>\n+.<RED>class-form<RESET><GREEN>other-form<RESET> label.control-label {\n+    margin-top: <RED>10<RESET><GREEN>15<RESET>px!important;\n+    border : 10px <RED>dashed<RESET><GREEN>dotted<RESET> #C6C6C6;\n+}<RESET>\n+<RED>#CCCCCC<RESET><GREEN>#CCCCCB<RESET>\n+10em<RESET>\n+<RED>padding-bottom<RESET><GREEN>margin-left<RESET>\n+150<RED>px<RESET><GREEN>em<RESET>\n+10px\n+<RED>!important<RESET>\n+<RED>div<RESET><GREEN>li<RESET>.class#id\ndiff --git a/t/t4034/css/post b/t/t4034/css/post\nnew file mode 100644\nindex 0000000..fe500b7\n--- /dev/null\n+++ b/t/t4034/css/post\n@@ -0,0 +1,10 @@\n+.other-form label.control-label {\n+    margin-top: 15px!important;\n+    border : 10px dotted #C6C6C6;\n+}\n+#CCCCCB\n+10em\n+margin-left\n+150em\n+10px\n+li.class#id\ndiff --git a/t/t4034/css/pre b/t/t4034/css/pre\nnew file mode 100644\nindex 0000000..b8ae0bb\n--- /dev/null\n+++ b/t/t4034/css/pre\n@@ -0,0 +1,10 @@\n+.class-form label.control-label {\n+    margin-top: 10px!important;\n+    border : 10px dashed #C6C6C6;\n+}\n+#CCCCCC\n+10em\n+padding-bottom\n+150px\n+10px!important\n+div.class#id\ndiff --git a/userdiff.c b/userdiff.c\nindex 6bf2505..9273969 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -148,6 +148,14 @@ PATTERNS(\"csharp\",\n \t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n \t \"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?\"\n \t \"|[-+*/<>%&^|=!]=|--|\\\\+\\\\+|<<=?|>>=?|&&|\\\\|\\\\||::|->\"),\n+PATTERNS(\"css\",\n+\t \"^([^,{}]+)((,[^}]*\\\\{)|([ \\t]*\\\\{))$\",\n+\t /* -- */\n+\t /* This regex comes from W3C CSS specs. Should theoretically also allow ISO 10646 characters U+00A0 and higher,\n+\t  * but they are not handled with this regex. */\n+\t \"-?[_a-zA-Z][-_a-zA-Z0-9]*\" /* identifiers */\n+\t \"|-?[0-9]+|\\\\#[0-9a-fA-F]+\" /* numbers */\n+),\n { \"default\", NULL, -1, { NULL, 0 } },\n };\n #undef PATTERNS\n-- \n2.9.0.rc0.1.g521d471.dirty\n"},{"id":"287442","messageId":"xmqqmvnf46on.fsf@gitster.mtv.corp.google.com","threadId":"42398","inReplyTo":"20160524142537.19324-1-william.duclot@ensimag.grenoble-inp.fr","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-24T19:06:16Z","receivedAt":"2016-05-24T19:06:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:\n\n> CSS is widely used, motivating it being included as a built-in pattern.\n>\n> It must be noted that the word_regex for CSS (i.e. the regex defining\n> what is a word in the language) does not consider '.' and '#' characters\n> (in CSS selectors) to be part of the word. This behavior is documented\n> by the test t/t4018/css-rule.\n> The logic behind this behavior is the following: identifiers in CSS\n> selectors are identifiers in a HTML/XML document. Therefore, the '.'/'#'\n> character are not part of the identifier, but an indicator of the nature\n> of the identifier in HTML/XML (class or id). Diffing \".class1\" and\n> \".class2\" must show that the class name is changed, but we still are\n> selecting a class.\n>\n> Signed-off-by: William Duclot <william.duclot@ensimag.grenoble-inp.fr>\n> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>\n> ---\n> changes since v1:\n> Fix a typo in the word_regex (\"A-F\" => \"A-Z\").\n> Clearer comment about ISO 10646 characters.\n\nIt is not a big deal for a small single-patch topic like this, but\nit often is hard to reviewers if you do not respond to comments you\nreceived and instead just send a new version of the patch with\n\"changes since...\" comment.  Please make it a habit to do both.\n\nI can see in the above \"changes since v1\" comment, you took the\nA-F/A-Z thing, but I cannot tell if you thought about PATTERNS vs\nIPATTERN and rejected IPATTERN with a good reason or if you simply\nmissed it when reading the review comments you received, for\nexample.\n\nThree remaining issues are:\n\n - Have you considered using IPATTERN()?  PATTERNS() that defaults\n   case sensitive match is suitable for real languages with fixed\n   case keywords, but the pattern you are defining for CSS does not\n   do anything special for any set of fixed-case built-in keywords,\n   and appears to be better served by IPATTERN().\n\n - In our codebase, we format multi-line comments in a particular\n   way, namely\n\n\t/*\n         * A multi-line comment begins with slash asterisk\n         * on its own line, and its closing asterisk slash\n         * also is on its own line.\n         */\n\n - Try not to write overlong lines.  If your expression needs to\n   become long and there is no good place to fold lines, that is one\n   thing, but an overlong comment is unexcuable, as you can fold\n   lines anywhere between words.\n\nThanks.\n\n> diff --git a/userdiff.c b/userdiff.c\n> index 6bf2505..9273969 100644\n> --- a/userdiff.c\n> +++ b/userdiff.c\n> @@ -148,6 +148,14 @@ PATTERNS(\"csharp\",\n>  \t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n>  \t \"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?\"\n>  \t \"|[-+*/<>%&^|=!]=|--|\\\\+\\\\+|<<=?|>>=?|&&|\\\\|\\\\||::|->\"),\n> +PATTERNS(\"css\",\n> +\t \"^([^,{}]+)((,[^}]*\\\\{)|([ \\t]*\\\\{))$\",\n> +\t /* -- */\n> +\t /* This regex comes from W3C CSS specs. Should theoretically also allow ISO 10646 characters U+00A0 and higher,\n> +\t  * but they are not handled with this regex. */\n> +\t \"-?[_a-zA-Z][-_a-zA-Z0-9]*\" /* identifiers */\n> +\t \"|-?[0-9]+|\\\\#[0-9a-fA-F]+\" /* numbers */\n> +),\n>  { \"default\", NULL, -1, { NULL, 0 } },\n>  };\n>  #undef PATTERNS\n"},{"id":"287457","messageId":"925654601.13199.1464127975010.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"42398","inReplyTo":"xmqqmvnf46on.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"William Duclot","fromEmail":"william.duclot@ensimag.grenoble-inp.fr","sentAt":"2016-05-24T22:12:55Z","receivedAt":"2016-05-24T22:12:55Z","isPatch":true,"sender":{"key":"william.duclot@ensimag.grenoble-inp.fr","avatar":null},"body":"> It is not a big deal for a small single-patch topic like this, but\n> it often is hard to reviewers if you do not respond to comments you\n> received and instead just send a new version of the patch with\n> \"changes since...\" comment.  Please make it a habit to do both.\n\nApologies, I am not quite used to work with a mailing list yet, I\nwill make sure to respect this in the future!\n \n>  - Have you considered using IPATTERN()?  PATTERNS() that defaults\n>    case sensitive match is suitable for real languages with fixed\n>    case keywords, but the pattern you are defining for CSS does not\n>    do anything special for any set of fixed-case built-in keywords,\n>    and appears to be better served by IPATTERN().\n\nI did have considered IPATTERN(), but assumed that case-sensitive was\ndefault and case-insensitive was the exception. As the CSS pattern\ndoes not deal with letters at all it seemed sensible to me to follow\nthe example of the HTML pattern, which use PATTERNS().\n\n>  - In our codebase, we format multi-line comments in a particular\n>    way, namely\n> \n> \t/*\n>          * A multi-line comment begins with slash asterisk\n>          * on its own line, and its closing asterisk slash\n>          * also is on its own line.\n>          */\n\nI take good note of that. I took example on the fortran pattern\ncomment, should I fix it too while I'm at it?\n \n>  - Try not to write overlong lines.  If your expression needs to\n>    become long and there is no good place to fold lines, that is one\n>    thing, but an overlong comment is unexcuable, as you can fold\n>    lines anywhere between words.\n\nAgain, I take good note of that.\n\nThank you for your time!\n"},{"id":"287458","messageId":"xmqq37p73xrg.fsf@gitster.mtv.corp.google.com","threadId":"42398","inReplyTo":"925654601.13199.1464127975010.JavaMail.zimbra@ensimag.grenoble-inp.fr","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-24T22:18:59Z","receivedAt":"2016-05-24T22:18:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:\n\n> I did have considered IPATTERN(), but assumed that case-sensitive was\n> default and case-insensitive was the exception.\n\nDon't assume, but ask ;-)\n\n> As the CSS pattern\n> does not deal with letters at all it seemed sensible to me to follow\n> the example of the HTML pattern, which use PATTERNS().\n\nDid you notice that HTML pattern has to do an [Hh] that would be\nunnecessary if it chose to use IPATTTERN()?\n\nYou do not have to ask a person, but instead ask the history.\nIPATTERN() was added at 909a5494 (userdiff.c: add builtin fortran\nregex patterns, 2010-09-10) when adding fortran support.  Anything\nthat existed before, including HTML, did [A-Za-z] when they could\nhave done [a-z] if IPATTERN() existed back then.\n\n>>  - In our codebase, we format multi-line comments in a particular\n>>    way, namely\n>> \n>> \t   /*\n>>          * A multi-line comment begins with slash asterisk\n>>          * on its own line, and its closing asterisk slash\n>>          * also is on its own line.\n>>          */\n>\n> I take good note of that. I took example on the fortran pattern\n> comment, should I fix it too while I'm at it?\n\nNot \"while you are at it\".\n\nMaking existing things better is welcome but such a change shouldn't\nbe mixed with addition of new things.  You can do it as a separate\npatch, probably as a preliminary clean-up before your change, if you\nwant to.\n\n>>  - Try not to write overlong lines.  If your expression needs to\n>>    become long and there is no good place to fold lines, that is one\n>>    thing, but an overlong comment is unexcuable, as you can fold\n>>    lines anywhere between words.\n>\n> Again, I take good note of that.\n>\n> Thank you for your time!\n\nThank you for working on this.\n"},{"id":"287614","messageId":"5747669C.9020807@kdbg.org","threadId":"42398","inReplyTo":"20160524142537.19324-1-william.duclot@ensimag.grenoble-inp.fr","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-05-26T21:11:56Z","receivedAt":"2016-05-26T21:11:56Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 24.05.2016 um 16:25 schrieb William Duclot:\n> +PATTERNS(\"css\",\n> +\t \"^([^,{}]+)((,[^}]*\\\\{)|([ \\t]*\\\\{))$\",\n\nThis hunk header pattern is a bit too restrictive for my taste. Find\nbelow a few more test cases that you should squash in. One case fails\nbecause only the first CSS selector is picked up, for which I do not\nsee a reason.\n\nAnother case fails because the opening brace is not on the line with\nthe CSS selectors.\n\nI think what the hunk header pattern should do is:\n\n1. reject lines containing a colon (because that are properties)\n2. if a line begins with a name in column 1, pick the whole line\n\nSee the cpp patterns: a pattern beginning with ! is a \"reject\" pattern.\n\n\ndiff --git a/t/t4018/css-brace-in-col-1 b/t/t4018/css-brace-in-col-1\nnew file mode 100644\nindex 0000000..7831577\n--- /dev/null\n+++ b/t/t4018/css-brace-in-col-1\n@@ -0,0 +1,5 @@\n+RIGHT label.control-label\n+{\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-rule b/t/t4018/css-common\nsimilarity index 100%\nrename from t/t4018/css-rule\nrename to t/t4018/css-common\ndiff --git a/t/t4018/css-long-selector-list b/t/t4018/css-long-selector-list\nnew file mode 100644\nindex 0000000..7ccd25d\n--- /dev/null\n+++ b/t/t4018/css-long-selector-list\n@@ -0,0 +1,6 @@\n+p.header,\n+label.control-label,\n+div ul#RIGHT {\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-prop-sans-indent b/t/t4018/css-prop-sans-indent\nnew file mode 100644\nindex 0000000..a9e3c86\n--- /dev/null\n+++ b/t/t4018/css-prop-sans-indent\n@@ -0,0 +1,5 @@\n+RIGHT, label.control-label {\n+margin-top: 10px!important;\n+padding: 0;\n+border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-short-selector-list b/t/t4018/css-short-selector-list\nnew file mode 100644\nindex 0000000..6a0bdee\n--- /dev/null\n+++ b/t/t4018/css-short-selector-list\n@@ -0,0 +1,4 @@\n+label.control, div ul#RIGHT {\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\n-- \n2.9.0.rc0.40.gb3c1388\n"},{"id":"287662","messageId":"2067613701.116691.1464335297679.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"42398","inReplyTo":"5747669C.9020807@kdbg.org","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"William Duclot","fromEmail":"william.duclot@ensimag.grenoble-inp.fr","sentAt":"2016-05-27T07:48:17Z","receivedAt":"2016-05-27T07:48:17Z","isPatch":true,"sender":{"key":"william.duclot@ensimag.grenoble-inp.fr","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> writes:\n> William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:\n>\n>> As the CSS pattern\n>> does not deal with letters at all it seemed sensible to me to follow\n>> the example of the HTML pattern, which use PATTERNS().\n> \n> Did you notice that HTML pattern has to do an [Hh] that would be\n> unnecessary if it chose to use IPATTTERN()?\n> \n> You do not have to ask a person, but instead ask the history.\n> IPATTERN() was added at 909a5494 (userdiff.c: add builtin fortran\n> regex patterns, 2010-09-10) when adding fortran support.  Anything\n> that existed before, including HTML, did [A-Za-z] when they could\n> have done [a-z] if IPATTERN() existed back then.\n\nI hadn't noticed that the HTML pattern was older, indeed\n\n>>>  - In our codebase, we format multi-line comments in a particular\n>>>    way, namely\n>>> \n>>> \t   /*\n>>>          * A multi-line comment begins with slash asterisk\n>>>          * on its own line, and its closing asterisk slash\n>>>          * also is on its own line.\n>>>          */\n>>\n>> I take good note of that. I took example on the fortran pattern\n>> comment, should I fix it too while I'm at it?\n> \n> Not \"while you are at it\".\n> \n> Making existing things better is welcome but such a change shouldn't\n> be mixed with addition of new things.  You can do it as a separate\n> patch, probably as a preliminary clean-up before your change, if you\n> want to.\n\nOK !\n\n\nJohannes Sixt <j6t@kdbg.org> writes:\n> Am 24.05.2016 um 16:25 schrieb William Duclot:\n>> +PATTERNS(\"css\",\n>> +\t \"^([^,{}]+)((,[^}]*\\\\{)|([ \\t]*\\\\{))$\",\n> \n> This hunk header pattern is a bit too restrictive for my taste. Find\n> below a few more test cases that you should squash in. One case fails\n> because only the first CSS selector is picked up, for which I do not\n> see a reason.\n> \n> Another case fails because the opening brace is not on the line with\n> the CSS selectors.\n\nYes, it seems you're right !\n\n> I think what the hunk header pattern should do is:\n> \n> 1. reject lines containing a colon (because that are properties)\n> 2. if a line begins with a name in column 1, pick the whole line\n> \n> See the cpp patterns: a pattern beginning with ! is a \"reject\" pattern.\n\nThat may be a good idea, I will look into that\n\n> diff --git a/t/t4018/css-brace-in-col-1 b/t/t4018/css-brace-in-col-1\n> new file mode 100644\n> index 0000000..7831577\n> --- /dev/null\n> +++ b/t/t4018/css-brace-in-col-1\n> @@ -0,0 +1,5 @@\n> +RIGHT label.control-label\n> +{\n> +    margin-top: 10px!important;\n> +    border : 10px ChangeMe #C6C6C6;\n> +}\n> diff --git a/t/t4018/css-rule b/t/t4018/css-common\n> similarity index 100%\n> rename from t/t4018/css-rule\n> rename to t/t4018/css-common\n> diff --git a/t/t4018/css-long-selector-list b/t/t4018/css-long-selector-list\n> new file mode 100644\n> index 0000000..7ccd25d\n> --- /dev/null\n> +++ b/t/t4018/css-long-selector-list\n> @@ -0,0 +1,6 @@\n> +p.header,\n> +label.control-label,\n> +div ul#RIGHT {\n> +    margin-top: 10px!important;\n> +    border : 10px ChangeMe #C6C6C6;\n> +}\n> diff --git a/t/t4018/css-prop-sans-indent b/t/t4018/css-prop-sans-indent\n> new file mode 100644\n> index 0000000..a9e3c86\n> --- /dev/null\n> +++ b/t/t4018/css-prop-sans-indent\n> @@ -0,0 +1,5 @@\n> +RIGHT, label.control-label {\n> +margin-top: 10px!important;\n> +padding: 0;\n> +border : 10px ChangeMe #C6C6C6;\n> +}\n> diff --git a/t/t4018/css-short-selector-list\n> b/t/t4018/css-short-selector-list\n> new file mode 100644\n> index 0000000..6a0bdee\n> --- /dev/null\n> +++ b/t/t4018/css-short-selector-list\n> @@ -0,0 +1,4 @@\n> +label.control, div ul#RIGHT {\n> +    margin-top: 10px!important;\n> +    border : 10px ChangeMe #C6C6C6;\n> +}\n> --\n> 2.9.0.rc0.40.gb3c1388\n\nThanks for the test cases, I'll look into that as soon as I have time\n"},{"id":"288171","messageId":"20160602224809.5167-1-william.duclot@ensimag.grenoble-inp.fr","threadId":"42398","inReplyTo":"20160524142537.19324-1-william.duclot@ensimag.grenoble-inp.fr","subject":"[PATCH] userdiff: add built-in pattern for CSS","fromName":"William Duclot","fromEmail":"william.duclot@ensimag.grenoble-inp.fr","sentAt":"2016-06-02T22:48:09Z","receivedAt":"2016-06-02T22:48:09Z","isPatch":true,"sender":{"key":"william.duclot@ensimag.grenoble-inp.fr","avatar":null},"body":"CSS is widely used, motivating it being included as a built-in pattern.\n\nIt must be noted that the word_regex for CSS (i.e. the regex defining\nwhat is a word in the language) does not consider '.' and '#' characters\n(in CSS selectors) to be part of the word. This behavior is documented\nby the test t/t4018/css-rule.\nThe logic behind this behavior is the following: identifiers in CSS\nselectors are identifiers in a HTML/XML document. Therefore, the '.'/'#'\ncharacter are not part of the identifier, but an indicator of the nature\nof the identifier in HTML/XML (class or id). Diffing \".class1\" and\n\".class2\" must show that the class name is changed, but we still are\nselecting a class.\n\nLogic behind the \"pattern\" regex is:\n    1. reject lines containing a colon (properties)\n    2. if a line begins with a name in column 1, pick the whole line\n\nCredits to Johannes Sixt (j6t@kdbg.org) for the pattern regex and most\nof the tests.\n\nSigned-off-by: William Duclot <william.duclot@ensimag.grenoble-inp.fr>\nSigned-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>\n---\nChanges since V2:\n    - pattern regex has changed\n    - more tests\n\n Documentation/gitattributes.txt |  2 ++\n t/t4018-diff-funcname.sh        |  1 +\n t/t4018/css-brace-in-col-1      |  5 +++++\n t/t4018/css-common              |  4 ++++\n t/t4018/css-long-selector-list  |  6 ++++++\n t/t4018/css-prop-sans-indent    |  5 +++++\n t/t4018/css-rule                |  4 ++++\n t/t4018/css-short-selector-list |  4 ++++\n t/t4034-diff-words.sh           |  1 +\n t/t4034/css/expect              | 16 ++++++++++++++++\n t/t4034/css/post                | 10 ++++++++++\n t/t4034/css/pre                 | 10 ++++++++++\n userdiff.c                      | 12 ++++++++++++\n 13 files changed, 80 insertions(+)\n create mode 100644 t/t4018/css-brace-in-col-1\n create mode 100644 t/t4018/css-common\n create mode 100644 t/t4018/css-long-selector-list\n create mode 100644 t/t4018/css-prop-sans-indent\n create mode 100644 t/t4018/css-rule\n create mode 100644 t/t4018/css-short-selector-list\n create mode 100644 t/t4034/css/expect\n create mode 100644 t/t4034/css/post\n create mode 100644 t/t4034/css/pre\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex e3b1de8..81f60ad 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -525,6 +525,8 @@ patterns are available:\n \n - `csharp` suitable for source code in the C# language.\n \n+- `css` suitable for source code in the CSS language.\n+\n - `fortran` suitable for source code in the Fortran language.\n \n - `fountain` suitable for Fountain documents.\ndiff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh\nindex 67373dc..1795ffc 100755\n--- a/t/t4018-diff-funcname.sh\n+++ b/t/t4018-diff-funcname.sh\n@@ -30,6 +30,7 @@ diffpatterns=\"\n \tbibtex\n \tcpp\n \tcsharp\n+\tcss\n \tfortran\n \tfountain\n \thtml\ndiff --git a/t/t4018/css-brace-in-col-1 b/t/t4018/css-brace-in-col-1\nnew file mode 100644\nindex 0000000..7831577\n--- /dev/null\n+++ b/t/t4018/css-brace-in-col-1\n@@ -0,0 +1,5 @@\n+RIGHT label.control-label\n+{\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-common b/t/t4018/css-common\nnew file mode 100644\nindex 0000000..84ed754\n--- /dev/null\n+++ b/t/t4018/css-common\n@@ -0,0 +1,4 @@\n+RIGHT label.control-label {\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-long-selector-list b/t/t4018/css-long-selector-list\nnew file mode 100644\nindex 0000000..7ccd25d\n--- /dev/null\n+++ b/t/t4018/css-long-selector-list\n@@ -0,0 +1,6 @@\n+p.header,\n+label.control-label,\n+div ul#RIGHT {\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-prop-sans-indent b/t/t4018/css-prop-sans-indent\nnew file mode 100644\nindex 0000000..a9e3c86\n--- /dev/null\n+++ b/t/t4018/css-prop-sans-indent\n@@ -0,0 +1,5 @@\n+RIGHT, label.control-label {\n+margin-top: 10px!important;\n+padding: 0;\n+border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-rule b/t/t4018/css-rule\nnew file mode 100644\nindex 0000000..84ed754\n--- /dev/null\n+++ b/t/t4018/css-rule\n@@ -0,0 +1,4 @@\n+RIGHT label.control-label {\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-short-selector-list b/t/t4018/css-short-selector-list\nnew file mode 100644\nindex 0000000..6a0bdee\n--- /dev/null\n+++ b/t/t4018/css-short-selector-list\n@@ -0,0 +1,4 @@\n+label.control, div ul#RIGHT {\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh\nindex f2f55fc..912df91 100755\n--- a/t/t4034-diff-words.sh\n+++ b/t/t4034-diff-words.sh\n@@ -302,6 +302,7 @@ test_language_driver ada\n test_language_driver bibtex\n test_language_driver cpp\n test_language_driver csharp\n+test_language_driver css\n test_language_driver fortran\n test_language_driver html\n test_language_driver java\ndiff --git a/t/t4034/css/expect b/t/t4034/css/expect\nnew file mode 100644\nindex 0000000..ed10393\n--- /dev/null\n+++ b/t/t4034/css/expect\n@@ -0,0 +1,16 @@\n+<BOLD>diff --git a/pre b/post<RESET>\n+<BOLD>index b8ae0bb..fe500b7 100644<RESET>\n+<BOLD>--- a/pre<RESET>\n+<BOLD>+++ b/post<RESET>\n+<CYAN>@@ -1,10 +1,10 @@<RESET>\n+.<RED>class-form<RESET><GREEN>other-form<RESET> label.control-label {\n+    margin-top: <RED>10<RESET><GREEN>15<RESET>px!important;\n+    border : 10px <RED>dashed<RESET><GREEN>dotted<RESET> #C6C6C6;\n+}<RESET>\n+<RED>#CCCCCC<RESET><GREEN>#CCCCCB<RESET>\n+10em<RESET>\n+<RED>padding-bottom<RESET><GREEN>margin-left<RESET>\n+150<RED>px<RESET><GREEN>em<RESET>\n+10px\n+<RED>!important<RESET>\n+<RED>div<RESET><GREEN>li<RESET>.class#id\ndiff --git a/t/t4034/css/post b/t/t4034/css/post\nnew file mode 100644\nindex 0000000..fe500b7\n--- /dev/null\n+++ b/t/t4034/css/post\n@@ -0,0 +1,10 @@\n+.other-form label.control-label {\n+    margin-top: 15px!important;\n+    border : 10px dotted #C6C6C6;\n+}\n+#CCCCCB\n+10em\n+margin-left\n+150em\n+10px\n+li.class#id\ndiff --git a/t/t4034/css/pre b/t/t4034/css/pre\nnew file mode 100644\nindex 0000000..b8ae0bb\n--- /dev/null\n+++ b/t/t4034/css/pre\n@@ -0,0 +1,10 @@\n+.class-form label.control-label {\n+    margin-top: 10px!important;\n+    border : 10px dashed #C6C6C6;\n+}\n+#CCCCCC\n+10em\n+padding-bottom\n+150px\n+10px!important\n+div.class#id\ndiff --git a/userdiff.c b/userdiff.c\nindex 6bf2505..00fc3bf 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -148,6 +148,18 @@ PATTERNS(\"csharp\",\n \t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n \t \"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?\"\n \t \"|[-+*/<>%&^|=!]=|--|\\\\+\\\\+|<<=?|>>=?|&&|\\\\|\\\\||::|->\"),\n+IPATTERN(\"css\",\n+\t \"!^.*;\\n\"\n+\t \"^[_a-z0-9].*$\",\n+\t /* -- */\n+\t /*\n+\t  * This regex comes from W3C CSS specs. Should theoretically also\n+\t  * allow ISO 10646 characters U+00A0 and higher,\n+\t  * but they are not handled in this regex.\n+\t  */\n+\t \"-?[_a-zA-F][-_a-zA-F0-9]*\" /* identifiers */\n+\t \"|-?[0-9]+|\\\\#[0-9a-fA-F]+\" /* numbers */\n+),\n { \"default\", NULL, -1, { NULL, 0 } },\n };\n #undef PATTERNS\n-- \n2.8.2.403.ge2646ba.dirty\n"},{"id":"288175","messageId":"xmqq1t4frxz6.fsf@gitster.mtv.corp.google.com","threadId":"42398","inReplyTo":"20160602224809.5167-1-william.duclot@ensimag.grenoble-inp.fr","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-06-02T23:07:41Z","receivedAt":"2016-06-02T23:07:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:\n\n> diff --git a/userdiff.c b/userdiff.c\n> index 6bf2505..00fc3bf 100644\n> --- a/userdiff.c\n> +++ b/userdiff.c\n> @@ -148,6 +148,18 @@ PATTERNS(\"csharp\",\n>  \t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n>  \t \"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?\"\n>  \t \"|[-+*/<>%&^|=!]=|--|\\\\+\\\\+|<<=?|>>=?|&&|\\\\|\\\\||::|->\"),\n> +IPATTERN(\"css\",\n> +\t \"!^.*;\\n\"\n> +\t \"^[_a-z0-9].*$\",\n> +\t /* -- */\n> +\t /*\n> +\t  * This regex comes from W3C CSS specs. Should theoretically also\n> +\t  * allow ISO 10646 characters U+00A0 and higher,\n> +\t  * but they are not handled in this regex.\n> +\t  */\n> +\t \"-?[_a-zA-F][-_a-zA-F0-9]*\" /* identifiers */\n> +\t \"|-?[0-9]+|\\\\#[0-9a-fA-F]+\" /* numbers */\n\nYou could now lose A-F from the above two lines.  In fact, the first\nline \"identifiers\" has \"a-zA-F\", which probably would work correctly\nunder IPATTERN() to include 'G-Z' as part of the legit letters for\nidentifiers, but is indeed misleading.\n\n> +),\n>  { \"default\", NULL, -1, { NULL, 0 } },\n>  };\n>  #undef PATTERNS\n"},{"id":"288187","messageId":"57511B2D.7040501@kdbg.org","threadId":"42398","inReplyTo":"20160602224809.5167-1-william.duclot@ensimag.grenoble-inp.fr","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-06-03T05:52:45Z","receivedAt":"2016-06-03T05:52:45Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 03.06.2016 um 00:48 schrieb William Duclot:\n> Logic behind the \"pattern\" regex is:\n\nThe name of the macro parameter is \"pattern\", but the actual meaning is \n\"function name\" regex.\n\n> diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\n> index e3b1de8..81f60ad 100644\n> --- a/Documentation/gitattributes.txt\n> +++ b/Documentation/gitattributes.txt\n> @@ -525,6 +525,8 @@ patterns are available:\n>\n>   - `csharp` suitable for source code in the C# language.\n>\n> +- `css` suitable for source code in the CSS language.\n\nCSS is not so much source code. How about \"suitable for cascaded style \nsheets\"?\n\n> diff --git a/t/t4018/css-common b/t/t4018/css-common\n> new file mode 100644\n> index 0000000..84ed754\n> --- /dev/null\n> +++ b/t/t4018/css-common\n> @@ -0,0 +1,4 @@\n> +RIGHT label.control-label {\n> +    margin-top: 10px!important;\n> +    border : 10px ChangeMe #C6C6C6;\n> +}\n\n> diff --git a/t/t4018/css-rule b/t/t4018/css-rule\n> new file mode 100644\n> index 0000000..84ed754\n> --- /dev/null\n> +++ b/t/t4018/css-rule\n> @@ -0,0 +1,4 @@\n> +RIGHT label.control-label {\n> +    margin-top: 10px!important;\n> +    border : 10px ChangeMe #C6C6C6;\n> +}\n\nThese two are the same. Please pick only one. I propose the name \n\"common\" because it is how CSS rules are written most commonly.\n\n> +IPATTERN(\"css\",\n> +\t \"!^.*;\\n\"\n\nIs there a difference between this and \"!;\\n\"? Is it necessary to anchor \nthe pattern at the beginning of the line?\n\nIn the commit message you talk about colon (':'), but you actually use a \nsemicolon (';'). Thinking a bit more about it, rejecting lines with \neither one would be even better. Consider this case (without the \nindentation):\n\n    h1 {\n    color:\n    red;\n    }\n\n(New test case, hint, hint!) Therefore, it could be: \"![:;]\\n\".\n\n> +\t \"^[_a-z0-9].*$\",\n> +\t /* -- */\n> +\t /*\n> +\t  * This regex comes from W3C CSS specs. Should theoretically also\n> +\t  * allow ISO 10646 characters U+00A0 and higher,\n> +\t  * but they are not handled in this regex.\n> +\t  */\n> +\t \"-?[_a-zA-F][-_a-zA-F0-9]*\" /* identifiers */\n\nDrop A-F.\n\n> +\t \"|-?[0-9]+|\\\\#[0-9a-fA-F]+\" /* numbers */\n\nHere, too: it is an IPATTERN.\n\n-- Hannes\n"},{"id":"288190","messageId":"vpqr3ce6afi.fsf@anie.imag.fr","threadId":"42398","inReplyTo":"57511B2D.7040501@kdbg.org","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-06-03T06:41:53Z","receivedAt":"2016-06-03T06:41:53Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n>> +IPATTERN(\"css\",\n>> +\t \"!^.*;\\n\"\n>\n> Is there a difference between this and \"!;\\n\"? Is it necessary to\n> anchor the pattern at the beginning of the line?\n\nAlso, you don't want to force the end of line right after ;. I know\ntrailing whitespaces are evil, but users may not deserve to be punished\nso hard when they have some ;-).\n\n> In the commit message you talk about colon (':'), but you actually use\n> a semicolon (';'). Thinking a bit more about it, rejecting lines with\n> either one would be even better. Consider this case (without the\n> indentation):\n\nRejecting colon anywhere in the line would also reject valid patterns\nlike this:\n\na:hover {\n\nRejecting it at end of line is probably a good trade-off.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"288192","messageId":"57512A2F.7030100@kdbg.org","threadId":"42398","inReplyTo":"vpqr3ce6afi.fsf@anie.imag.fr","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-06-03T06:56:47Z","receivedAt":"2016-06-03T06:56:47Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 03.06.2016 um 08:41 schrieb Matthieu Moy:\n> Rejecting colon anywhere in the line would also reject valid patterns\n> like this:\n>\n> a:hover {\n>\n> Rejecting it at end of line is probably a good trade-off.\n\nGood point. Could be worth another test case.\n\n-- Hannes\n"},{"id":"288216","messageId":"20160603094544.GA3865@Messiaen","threadId":"42398","inReplyTo":"57511B2D.7040501@kdbg.org","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"William Duclot","fromEmail":"william.duclot@ensimag.grenoble-inp.fr","sentAt":"2016-06-03T09:45:44Z","receivedAt":"2016-06-03T09:45:44Z","isPatch":true,"sender":{"key":"william.duclot@ensimag.grenoble-inp.fr","avatar":null},"body":"On Fri, Jun 03, 2016 at 07:52:45AM +0200, Johannes Sixt wrote:\n> Am 03.06.2016 um 00:48 schrieb William Duclot:\n>>Logic behind the \"pattern\" regex is:\n> \n> The name of the macro parameter is \"pattern\", but the actual meaning\n> is \"function name\" regex.\n> \n>>diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\n>>index e3b1de8..81f60ad 100644\n>>--- a/Documentation/gitattributes.txt\n>>+++ b/Documentation/gitattributes.txt\n>>@@ -525,6 +525,8 @@ patterns are available:\n>>\n>>  - `csharp` suitable for source code in the C# language.\n>>\n>>+- `css` suitable for source code in the CSS language.\n> \n> CSS is not so much source code. How about \"suitable for cascaded\n> style sheets\"?\n\nTechnically correct yes\n \n>>diff --git a/t/t4018/css-common b/t/t4018/css-common\n>>new file mode 100644\n>>index 0000000..84ed754\n>>--- /dev/null\n>>+++ b/t/t4018/css-common\n>>@@ -0,0 +1,4 @@\n>>+RIGHT label.control-label {\n>>+    margin-top: 10px!important;\n>>+    border : 10px ChangeMe #C6C6C6;\n>>+}\n> \n>>diff --git a/t/t4018/css-rule b/t/t4018/css-rule\n>>new file mode 100644\n>>index 0000000..84ed754\n>>--- /dev/null\n>>+++ b/t/t4018/css-rule\n>>@@ -0,0 +1,4 @@\n>>+RIGHT label.control-label {\n>>+    margin-top: 10px!important;\n>>+    border : 10px ChangeMe #C6C6C6;\n>>+}\n> \n> These two are the same. Please pick only one. I propose the name\n> \"common\" because it is how CSS rules are written most commonly.\n\nRight, I was distracted\n\n>>+IPATTERN(\"css\",\n>>+\t \"!^.*;\\n\"\n> \n> Is there a difference between this and \"!;\\n\"? Is it necessary to\n> anchor the pattern at the beginning of the line?\n> \n> In the commit message you talk about colon (':'), but you actually\n> use a semicolon (';'). Thinking a bit more about it, rejecting lines\n> with either one would be even better. Consider this case (without\n> the indentation):\n> \n>    h1 {\n>    color:\n>    red;\n>    }\n> \n> (New test case, hint, hint!) Therefore, it could be: \"![:;]\\n\".\n\nYou're right! (plus the potential trailing spaces)\n\n>>+\t \"^[_a-z0-9].*$\",\n>>+\t /* -- */\n>>+\t /*\n>>+\t  * This regex comes from W3C CSS specs. Should theoretically also\n>>+\t  * allow ISO 10646 characters U+00A0 and higher,\n>>+\t  * but they are not handled in this regex.\n>>+\t  */\n>>+\t \"-?[_a-zA-F][-_a-zA-F0-9]*\" /* identifiers */\n> \n> Drop A-F.\n> \n>>+\t \"|-?[0-9]+|\\\\#[0-9a-fA-F]+\" /* numbers */\n> \n> Here, too: it is an IPATTERN.\n\nHere I have to disagree (with you and Junio): the IPATTERN is\ncase-insensitive only on the \"pattern\" regex, not the \"word_regex\"\nregex. It can be seen in the macro definition, and a quick test confirm\nthat (and we can see that the fortran word_regex, for example, bother\nwith uppercase and lowercase even thought it use IPATTERN).\nOn the identifier line, I have \"A-F\" instead of \"A-Z\" though\n"},{"id":"288235","messageId":"20160603123226.4687-1-william.duclot@ensimag.grenoble-inp.fr","threadId":"42398","inReplyTo":"20160602224809.5167-1-william.duclot@ensimag.grenoble-inp.fr","subject":"[PATCH] userdiff: add built-in pattern for CSS","fromName":"William Duclot","fromEmail":"william.duclot@ensimag.grenoble-inp.fr","sentAt":"2016-06-03T12:32:26Z","receivedAt":"2016-06-03T12:32:26Z","isPatch":true,"sender":{"key":"william.duclot@ensimag.grenoble-inp.fr","avatar":null},"body":"CSS is widely used, motivating it being included as a built-in pattern.\n\nIt must be noted that the word_regex for CSS (i.e. the regex defining\nwhat is a word in the language) does not consider '.' and '#' characters\n(in CSS selectors) to be part of the word. This behavior is documented\nby the test t/t4018/css-rule.\nThe logic behind this behavior is the following: identifiers in CSS\nselectors are identifiers in a HTML/XML document. Therefore, the '.'/'#'\ncharacter are not part of the identifier, but an indicator of the nature\nof the identifier in HTML/XML (class or id). Diffing \".class1\" and\n\".class2\" must show that the class name is changed, but we still are\nselecting a class.\n\nLogic behind the \"pattern\" regex is:\n    1. reject lines ending with a colon/semicolon (properties)\n    2. if a line begins with a name in column 1, pick the whole line\n\nCredits to Johannes Sixt (j6t@kdbg.org) for the pattern regex and most\nof the tests.\n\nSigned-off-by: William Duclot <william.duclot@ensimag.grenoble-inp.fr>\nSigned-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>\n---\nChanges since V3:\n    - Add a few tests\n    - Remove a redondant test\n    - Handle trailing spaces\n    - Reword in doc\n    - Improvement of the pattern regex\n\n Documentation/gitattributes.txt |  2 ++\n t/t4018-diff-funcname.sh        |  1 +\n t/t4018/css-brace-in-col-1      |  5 +++++\n t/t4018/css-colon-eol           |  4 ++++\n t/t4018/css-colon-selector      |  5 +++++\n t/t4018/css-common              |  4 ++++\n t/t4018/css-long-selector-list  |  6 ++++++\n t/t4018/css-prop-sans-indent    |  5 +++++\n t/t4018/css-short-selector-list |  4 ++++\n t/t4018/css-trailing-space      |  5 +++++\n t/t4034-diff-words.sh           |  1 +\n t/t4034/css/expect              | 16 ++++++++++++++++\n t/t4034/css/post                | 10 ++++++++++\n t/t4034/css/pre                 | 10 ++++++++++\n userdiff.c                      | 12 ++++++++++++\n 15 files changed, 90 insertions(+)\n create mode 100644 t/t4018/css-brace-in-col-1\n create mode 100644 t/t4018/css-colon-eol\n create mode 100644 t/t4018/css-colon-selector\n create mode 100644 t/t4018/css-common\n create mode 100644 t/t4018/css-long-selector-list\n create mode 100644 t/t4018/css-prop-sans-indent\n create mode 100644 t/t4018/css-short-selector-list\n create mode 100644 t/t4018/css-trailing-space\n create mode 100644 t/t4034/css/expect\n create mode 100644 t/t4034/css/post\n create mode 100644 t/t4034/css/pre\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex e3b1de8..8882a3e 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -525,6 +525,8 @@ patterns are available:\n \n - `csharp` suitable for source code in the C# language.\n \n+- `css` suitable for cascading style sheets.\n+\n - `fortran` suitable for source code in the Fortran language.\n \n - `fountain` suitable for Fountain documents.\ndiff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh\nindex 67373dc..1795ffc 100755\n--- a/t/t4018-diff-funcname.sh\n+++ b/t/t4018-diff-funcname.sh\n@@ -30,6 +30,7 @@ diffpatterns=\"\n \tbibtex\n \tcpp\n \tcsharp\n+\tcss\n \tfortran\n \tfountain\n \thtml\ndiff --git a/t/t4018/css-brace-in-col-1 b/t/t4018/css-brace-in-col-1\nnew file mode 100644\nindex 0000000..7831577\n--- /dev/null\n+++ b/t/t4018/css-brace-in-col-1\n@@ -0,0 +1,5 @@\n+RIGHT label.control-label\n+{\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-colon-eol b/t/t4018/css-colon-eol\nnew file mode 100644\nindex 0000000..5a30553\n--- /dev/null\n+++ b/t/t4018/css-colon-eol\n@@ -0,0 +1,4 @@\n+RIGHT h1 {\n+color:\n+ChangeMe;\n+}\ndiff --git a/t/t4018/css-colon-selector b/t/t4018/css-colon-selector\nnew file mode 100644\nindex 0000000..c6d71fb\n--- /dev/null\n+++ b/t/t4018/css-colon-selector\n@@ -0,0 +1,5 @@\n+RIGHT a:hover {\n+    margin-top:\n+    10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-common b/t/t4018/css-common\nnew file mode 100644\nindex 0000000..84ed754\n--- /dev/null\n+++ b/t/t4018/css-common\n@@ -0,0 +1,4 @@\n+RIGHT label.control-label {\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-long-selector-list b/t/t4018/css-long-selector-list\nnew file mode 100644\nindex 0000000..7ccd25d\n--- /dev/null\n+++ b/t/t4018/css-long-selector-list\n@@ -0,0 +1,6 @@\n+p.header,\n+label.control-label,\n+div ul#RIGHT {\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-prop-sans-indent b/t/t4018/css-prop-sans-indent\nnew file mode 100644\nindex 0000000..a9e3c86\n--- /dev/null\n+++ b/t/t4018/css-prop-sans-indent\n@@ -0,0 +1,5 @@\n+RIGHT, label.control-label {\n+margin-top: 10px!important;\n+padding: 0;\n+border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-short-selector-list b/t/t4018/css-short-selector-list\nnew file mode 100644\nindex 0000000..6a0bdee\n--- /dev/null\n+++ b/t/t4018/css-short-selector-list\n@@ -0,0 +1,4 @@\n+label.control, div ul#RIGHT {\n+    margin-top: 10px!important;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4018/css-trailing-space b/t/t4018/css-trailing-space\nnew file mode 100644\nindex 0000000..32b5606\n--- /dev/null\n+++ b/t/t4018/css-trailing-space\n@@ -0,0 +1,5 @@\n+RIGHT label.control-label {\n+    margin:10px;   \n+    padding:10px;\n+    border : 10px ChangeMe #C6C6C6;\n+}\ndiff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh\nindex f2f55fc..912df91 100755\n--- a/t/t4034-diff-words.sh\n+++ b/t/t4034-diff-words.sh\n@@ -302,6 +302,7 @@ test_language_driver ada\n test_language_driver bibtex\n test_language_driver cpp\n test_language_driver csharp\n+test_language_driver css\n test_language_driver fortran\n test_language_driver html\n test_language_driver java\ndiff --git a/t/t4034/css/expect b/t/t4034/css/expect\nnew file mode 100644\nindex 0000000..ed10393\n--- /dev/null\n+++ b/t/t4034/css/expect\n@@ -0,0 +1,16 @@\n+<BOLD>diff --git a/pre b/post<RESET>\n+<BOLD>index b8ae0bb..fe500b7 100644<RESET>\n+<BOLD>--- a/pre<RESET>\n+<BOLD>+++ b/post<RESET>\n+<CYAN>@@ -1,10 +1,10 @@<RESET>\n+.<RED>class-form<RESET><GREEN>other-form<RESET> label.control-label {\n+    margin-top: <RED>10<RESET><GREEN>15<RESET>px!important;\n+    border : 10px <RED>dashed<RESET><GREEN>dotted<RESET> #C6C6C6;\n+}<RESET>\n+<RED>#CCCCCC<RESET><GREEN>#CCCCCB<RESET>\n+10em<RESET>\n+<RED>padding-bottom<RESET><GREEN>margin-left<RESET>\n+150<RED>px<RESET><GREEN>em<RESET>\n+10px\n+<RED>!important<RESET>\n+<RED>div<RESET><GREEN>li<RESET>.class#id\ndiff --git a/t/t4034/css/post b/t/t4034/css/post\nnew file mode 100644\nindex 0000000..fe500b7\n--- /dev/null\n+++ b/t/t4034/css/post\n@@ -0,0 +1,10 @@\n+.other-form label.control-label {\n+    margin-top: 15px!important;\n+    border : 10px dotted #C6C6C6;\n+}\n+#CCCCCB\n+10em\n+margin-left\n+150em\n+10px\n+li.class#id\ndiff --git a/t/t4034/css/pre b/t/t4034/css/pre\nnew file mode 100644\nindex 0000000..b8ae0bb\n--- /dev/null\n+++ b/t/t4034/css/pre\n@@ -0,0 +1,10 @@\n+.class-form label.control-label {\n+    margin-top: 10px!important;\n+    border : 10px dashed #C6C6C6;\n+}\n+#CCCCCC\n+10em\n+padding-bottom\n+150px\n+10px!important\n+div.class#id\ndiff --git a/userdiff.c b/userdiff.c\nindex 6bf2505..2125d6d 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -148,6 +148,18 @@ PATTERNS(\"csharp\",\n \t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n \t \"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?\"\n \t \"|[-+*/<>%&^|=!]=|--|\\\\+\\\\+|<<=?|>>=?|&&|\\\\|\\\\||::|->\"),\n+IPATTERN(\"css\",\n+\t \"![:;][[:space:]]*$\\n\"\n+\t \"^[_a-z0-9].*$\",\n+\t /* -- */\n+\t /*\n+\t  * This regex comes from W3C CSS specs. Should theoretically also\n+\t  * allow ISO 10646 characters U+00A0 and higher,\n+\t  * but they are not handled in this regex.\n+\t  */\n+\t \"-?[_a-zA-Z][-_a-zA-Z0-9]*\" /* identifiers */\n+\t \"|-?[0-9]+|\\\\#[0-9a-fA-F]+\" /* numbers */\n+),\n { \"default\", NULL, -1, { NULL, 0 } },\n };\n #undef PATTERNS\n-- \n2.9.0.rc1.1.geac644e\n"},{"id":"288262","messageId":"xmqq8tymqnj9.fsf@gitster.mtv.corp.google.com","threadId":"42398","inReplyTo":"20160603094544.GA3865@Messiaen","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-06-03T15:50:50Z","receivedAt":"2016-06-03T15:50:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:\n\n> Here I have to disagree (with you and Junio): the IPATTERN is\n> case-insensitive only on the \"pattern\" regex, not the \"word_regex\"\n> regex.\n\nAhh, OK.  Obviously both of us overlooked that.  Thanks for pushing\nback.\n\n> On the identifier line, I have \"A-F\" instead of \"A-Z\" though\n\nYeah, that does need updating.\n"},{"id":"288333","messageId":"5751F747.1070700@kdbg.org","threadId":"42398","inReplyTo":"20160603123226.4687-1-william.duclot@ensimag.grenoble-inp.fr","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-06-03T21:31:51Z","receivedAt":"2016-06-03T21:31:51Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 03.06.2016 um 14:32 schrieb William Duclot:\n> CSS is widely used, motivating it being included as a built-in pattern.\n>\n> It must be noted that the word_regex for CSS (i.e. the regex defining\n> what is a word in the language) does not consider '.' and '#' characters\n> (in CSS selectors) to be part of the word. This behavior is documented\n> by the test t/t4018/css-rule.\n> The logic behind this behavior is the following: identifiers in CSS\n> selectors are identifiers in a HTML/XML document. Therefore, the '.'/'#'\n> character are not part of the identifier, but an indicator of the nature\n> of the identifier in HTML/XML (class or id). Diffing \".class1\" and\n> \".class2\" must show that the class name is changed, but we still are\n> selecting a class.\n>\n> Logic behind the \"pattern\" regex is:\n>      1. reject lines ending with a colon/semicolon (properties)\n>      2. if a line begins with a name in column 1, pick the whole line\n>\n> Credits to Johannes Sixt (j6t@kdbg.org) for the pattern regex and most\n> of the tests.\n>\n> Signed-off-by: William Duclot <william.duclot@ensimag.grenoble-inp.fr>\n> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>\n> ---\n> Changes since V3:\n>      - Add a few tests\n>      - Remove a redondant test\n>      - Handle trailing spaces\n>      - Reword in doc\n>      - Improvement of the pattern regex\n\nThanks, I think we can take this version.\n\n-- Hannes\n"},{"id":"288407","messageId":"20160606072800.GA3803@Messiaen","threadId":"42398","inReplyTo":"xmqq8tymqnj9.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"William Duclot","fromEmail":"william.duclot@ensimag.grenoble-inp.fr","sentAt":"2016-06-06T07:28:00Z","receivedAt":"2016-06-06T07:28:00Z","isPatch":true,"sender":{"key":"william.duclot@ensimag.grenoble-inp.fr","avatar":null},"body":"On Fri, Jun 03, 2016 at 08:50:50AM -0700, Junio C Hamano wrote:\n> William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:\n> \n> > Here I have to disagree (with you and Junio): the IPATTERN is\n> > case-insensitive only on the \"pattern\" regex, not the \"word_regex\"\n> > regex.\n> \n> Ahh, OK.  Obviously both of us overlooked that.  Thanks for pushing\n> back.\n> \n> > On the identifier line, I have \"A-F\" instead of \"A-Z\" though\n> \n> Yeah, that does need updating.\n\nNote that I sent a V4 :)\n"},{"id":"288465","messageId":"xmqqinxmxkmx.fsf@gitster.mtv.corp.google.com","threadId":"42398","inReplyTo":"20160606072800.GA3803@Messiaen","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-06-06T18:00:38Z","receivedAt":"2016-06-06T18:00:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:\n\n> On Fri, Jun 03, 2016 at 08:50:50AM -0700, Junio C Hamano wrote:\n>> William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:\n>> \n>> > Here I have to disagree (with you and Junio): the IPATTERN is\n>> > case-insensitive only on the \"pattern\" regex, not the \"word_regex\"\n>> > regex.\n>> \n>> Ahh, OK.  Obviously both of us overlooked that.  Thanks for pushing\n>> back.\n>> \n>> > On the identifier line, I have \"A-F\" instead of \"A-Z\" though\n>> \n>> Yeah, that does need updating.\n>\n> Note that I sent a V4 :)\n\nYup, thanks.  Isn't that what I queued as 0719f3ee (userdiff: add\nbuilt-in pattern for CSS, 2016-06-03)?\n"},{"id":"288487","messageId":"20160606204542.GA9280@Messiaen","threadId":"42398","inReplyTo":"xmqqinxmxkmx.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"William Duclot","fromEmail":"william.duclot@ensimag.grenoble-inp.fr","sentAt":"2016-06-06T20:45:42Z","receivedAt":"2016-06-06T20:45:42Z","isPatch":true,"sender":{"key":"william.duclot@ensimag.grenoble-inp.fr","avatar":null},"body":"On Mon, Jun 06, 2016 at 11:00:38AM -0700, Junio C Hamano wrote:\n> William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:\n> \n> > On Fri, Jun 03, 2016 at 08:50:50AM -0700, Junio C Hamano wrote:\n> >> William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:\n> >> \n> >> > Here I have to disagree (with you and Junio): the IPATTERN is\n> >> > case-insensitive only on the \"pattern\" regex, not the \"word_regex\"\n> >> > regex.\n> >> \n> >> Ahh, OK.  Obviously both of us overlooked that.  Thanks for pushing\n> >> back.\n> >> \n> >> > On the identifier line, I have \"A-F\" instead of \"A-Z\" though\n> >> \n> >> Yeah, that does need updating.\n> >\n> > Note that I sent a V4 :)\n> \n> Yup, thanks.  Isn't that what I queued as 0719f3ee (userdiff: add\n> built-in pattern for CSS, 2016-06-03)?\n\nIt is, my bad\n"},{"id":"288488","messageId":"xmqqporuuje2.fsf@gitster.mtv.corp.google.com","threadId":"42398","inReplyTo":"20160606204542.GA9280@Messiaen","subject":"Re: [PATCH] userdiff: add built-in pattern for CSS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-06-06T20:55:49Z","receivedAt":"2016-06-06T20:55:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:\n\n>> Yup, thanks.  Isn't that what I queued as 0719f3ee (userdiff: add\n>> built-in pattern for CSS, 2016-06-03)?\n>\n> It is, my bad\n\nNot your bad at all.  I am leaky and was asking you to double check;\nit was entirely possible that I missed your even newer patch and\nwhat was queued was the second from the last one.\n\nThanks.\n"}]}