{"thread":{"id":"46814","subject":"[PATCH] userdiff: fix HTML hunk header regexp","startedAt":"2017-09-23T07:54:15Z","lastAt":"2017-09-24T01:15:56Z","messageCount":2,"participants":["Ilya Kantor","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"328720","messageId":"CAFU8umjZL0nXUFbuZWVapTaCfAjtAoTT=G3GCKczDE7O8bzAOw@mail.gmail.com","threadId":"46814","inReplyTo":null,"subject":"[PATCH] userdiff: fix HTML hunk header regexp","fromName":"Ilya Kantor","fromEmail":"iliakan@gmail.com","sentAt":"2017-09-23T07:53:47Z","receivedAt":"2017-09-23T07:54:15Z","isPatch":true,"sender":{"key":"iliakan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349336?v=4"},"body":"Current HTML header regexp doesn't match headers without attributes.\n\nSo it fails to match <h1>...</h1>, while <h1 class=\"smth\">...</h1> matches.\nThe fix makes attributes optional.\nThe regexp is still far from perfect, but now it at least handles the\ncommon case.\n\nSigned-off-by: Ilya Kantor <iliakan@gmail.com>\n---\n userdiff.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/userdiff.c b/userdiff.c\nindex 6321103ce..dbfb4e13c 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -38,7 +38,7 @@ IPATTERN(\"fortran\",\n  \"|//|\\\\*\\\\*|::|[/<>=]=\"),\n IPATTERN(\"fountain\", \"^((\\\\.[^.]|(int|ext|est|int\\\\.?/ext|i/e)[. ]).*)$\",\n  \"[^ \\t-]+\"),\n-PATTERNS(\"html\", \"^[ \\t]*(<[Hh][1-6][ \\t].*>.*)$\",\n+PATTERNS(\"html\", \"^[ \\t]*(<[Hh][1-6]([ \\t].*)?>.*)$\",\n  \"[^<>= \\t]+\"),\n PATTERNS(\"java\",\n  \"!^[ \\t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\\n\"\n--\n2.14.1\n\n---\nBest Regards,\nIlya Kantor\n"},{"id":"328756","messageId":"xmqqa81kj3qy.fsf@gitster.mtv.corp.google.com","threadId":"46814","inReplyTo":"CAFU8umjZL0nXUFbuZWVapTaCfAjtAoTT=G3GCKczDE7O8bzAOw@mail.gmail.com","subject":"Re: [PATCH] userdiff: fix HTML hunk header regexp","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-09-24T01:15:49Z","receivedAt":"2017-09-24T01:15:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ilya Kantor <iliakan@gmail.com> writes:\n\n> Current HTML header regexp doesn't match headers without attributes.\n>\n> So it fails to match <h1>...</h1>, while <h1 class=\"smth\">...</h1> matches.\n> The fix makes attributes optional.\n> The regexp is still far from perfect, but now it at least handles the\n> common case.\n>\n> Signed-off-by: Ilya Kantor <iliakan@gmail.com>\n> ---\n>  userdiff.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/userdiff.c b/userdiff.c\n> index 6321103ce..dbfb4e13c 100644\n> --- a/userdiff.c\n> +++ b/userdiff.c\n> @@ -38,7 +38,7 @@ IPATTERN(\"fortran\",\n>   \"|//|\\\\*\\\\*|::|[/<>=]=\"),\n>  IPATTERN(\"fountain\", \"^((\\\\.[^.]|(int|ext|est|int\\\\.?/ext|i/e)[. ]).*)$\",\n>   \"[^ \\t-]+\"),\n> -PATTERNS(\"html\", \"^[ \\t]*(<[Hh][1-6][ \\t].*>.*)$\",\n> +PATTERNS(\"html\", \"^[ \\t]*(<[Hh][1-6]([ \\t].*)?>.*)$\",\n>   \"[^<>= \\t]+\"),\n\n\nWhat you sent seems to be whitespace damaged, but it was small\nenough for me to tweak it to apply ;-)\n\nWill queue.  Thanks.\n\n"}]}