{"thread":{"id":"48823","subject":"[PATCH 0/2] userdiff: support new keywords in PHP hunk header","startedAt":"2018-07-03T13:17:20Z","lastAt":"2018-07-06T21:59:31Z","messageCount":4,"participants":["Kana Natsuno","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"351620","messageId":"20180703131540.60789-1-dev@whileimautomaton.net","threadId":"48823","inReplyTo":null,"subject":"[PATCH 0/2] userdiff: support new keywords in PHP hunk header","fromName":"Kana Natsuno","fromEmail":"dev@whileimautomaton.net","sentAt":"2018-07-03T13:15:38Z","receivedAt":"2018-07-03T13:17:20Z","isPatch":true,"sender":{"key":"dev@whileimautomaton.net","avatar":"https://avatars.githubusercontent.com/u/1742?v=4"},"body":"Recent version of PHP supports interface, trait, abstract class and\nfinal class.  This patch fixes the PHP hunk header regexp to support\nall of these keywords.\n\nKana Natsuno (2):\n  t4018: add missing test cases for PHP\n  userdiff: support new keywords in PHP hunk header\n\n t/t4018/php-abstract-class | 4 ++++\n t/t4018/php-class          | 4 ++++\n t/t4018/php-final-class    | 4 ++++\n t/t4018/php-function       | 4 ++++\n t/t4018/php-interface      | 4 ++++\n t/t4018/php-method         | 7 +++++++\n t/t4018/php-trait          | 7 +++++++\n userdiff.c                 | 2 +-\n 8 files changed, 35 insertions(+), 1 deletion(-)\n create mode 100644 t/t4018/php-abstract-class\n create mode 100644 t/t4018/php-class\n create mode 100644 t/t4018/php-final-class\n create mode 100644 t/t4018/php-function\n create mode 100644 t/t4018/php-interface\n create mode 100644 t/t4018/php-method\n create mode 100644 t/t4018/php-trait\n\n-- \n2.10.1 (Apple Git-78)\n\n"},{"id":"351621","messageId":"20180703131540.60789-2-dev@whileimautomaton.net","threadId":"48823","inReplyTo":"20180703131540.60789-1-dev@whileimautomaton.net","subject":"[PATCH 1/2] t4018: add missing test cases for PHP","fromName":"Kana Natsuno","fromEmail":"dev@whileimautomaton.net","sentAt":"2018-07-03T13:15:39Z","receivedAt":"2018-07-03T13:17:25Z","isPatch":true,"sender":{"key":"dev@whileimautomaton.net","avatar":"https://avatars.githubusercontent.com/u/1742?v=4"},"body":"A later patch changes the built-in PHP pattern. These test cases\ndemonstrate aspects of the pattern that we do not want to change.\n\nSigned-off-by: Kana Natsuno <dev@whileimautomaton.net>\n---\n t/t4018/php-class    | 4 ++++\n t/t4018/php-function | 4 ++++\n t/t4018/php-method   | 7 +++++++\n 3 files changed, 15 insertions(+)\n create mode 100644 t/t4018/php-class\n create mode 100644 t/t4018/php-function\n create mode 100644 t/t4018/php-method\n\ndiff --git a/t/t4018/php-class b/t/t4018/php-class\nnew file mode 100644\nindex 0000000..7785b63\n--- /dev/null\n+++ b/t/t4018/php-class\n@@ -0,0 +1,4 @@\n+class RIGHT\n+{\n+    const FOO = 'ChangeMe';\n+}\ndiff --git a/t/t4018/php-function b/t/t4018/php-function\nnew file mode 100644\nindex 0000000..35717c5\n--- /dev/null\n+++ b/t/t4018/php-function\n@@ -0,0 +1,4 @@\n+function RIGHT()\n+{\n+    return 'ChangeMe';\n+}\ndiff --git a/t/t4018/php-method b/t/t4018/php-method\nnew file mode 100644\nindex 0000000..03af1a6\n--- /dev/null\n+++ b/t/t4018/php-method\n@@ -0,0 +1,7 @@\n+class Klass\n+{\n+    public static function RIGHT()\n+    {\n+        return 'ChangeMe';\n+    }\n+}\n-- \n2.10.1 (Apple Git-78)\n\n"},{"id":"351622","messageId":"20180703131540.60789-3-dev@whileimautomaton.net","threadId":"48823","inReplyTo":"20180703131540.60789-1-dev@whileimautomaton.net","subject":"[PATCH 2/2] userdiff: support new keywords in PHP hunk header","fromName":"Kana Natsuno","fromEmail":"dev@whileimautomaton.net","sentAt":"2018-07-03T13:15:40Z","receivedAt":"2018-07-03T13:17:29Z","isPatch":true,"sender":{"key":"dev@whileimautomaton.net","avatar":"https://avatars.githubusercontent.com/u/1742?v=4"},"body":"Recent version of PHP supports interface, trait, abstract class and\nfinal class.  This patch fixes the PHP hunk header regexp to support\nall of these keywords.\n\nSigned-off-by: Kana Natsuno <dev@whileimautomaton.net>\n---\n t/t4018/php-abstract-class | 4 ++++\n t/t4018/php-final-class    | 4 ++++\n t/t4018/php-interface      | 4 ++++\n t/t4018/php-trait          | 7 +++++++\n userdiff.c                 | 2 +-\n 5 files changed, 20 insertions(+), 1 deletion(-)\n create mode 100644 t/t4018/php-abstract-class\n create mode 100644 t/t4018/php-final-class\n create mode 100644 t/t4018/php-interface\n create mode 100644 t/t4018/php-trait\n\ndiff --git a/t/t4018/php-abstract-class b/t/t4018/php-abstract-class\nnew file mode 100644\nindex 0000000..5213e12\n--- /dev/null\n+++ b/t/t4018/php-abstract-class\n@@ -0,0 +1,4 @@\n+abstract class RIGHT\n+{\n+    const FOO = 'ChangeMe';\n+}\ndiff --git a/t/t4018/php-final-class b/t/t4018/php-final-class\nnew file mode 100644\nindex 0000000..69f5710\n--- /dev/null\n+++ b/t/t4018/php-final-class\n@@ -0,0 +1,4 @@\n+final class RIGHT\n+{\n+    const FOO = 'ChangeMe';\n+}\ndiff --git a/t/t4018/php-interface b/t/t4018/php-interface\nnew file mode 100644\nindex 0000000..86b49ad\n--- /dev/null\n+++ b/t/t4018/php-interface\n@@ -0,0 +1,4 @@\n+interface RIGHT\n+{\n+    public function foo($ChangeMe);\n+}\ndiff --git a/t/t4018/php-trait b/t/t4018/php-trait\nnew file mode 100644\nindex 0000000..65b8c82\n--- /dev/null\n+++ b/t/t4018/php-trait\n@@ -0,0 +1,7 @@\n+trait RIGHT\n+{\n+    public function foo($ChangeMe)\n+    {\n+        return 'foo';\n+    }\n+}\ndiff --git a/userdiff.c b/userdiff.c\nindex a69241b..36af25e 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -114,7 +114,7 @@ PATTERNS(\"perl\",\n \t \"|<<|<>|<=>|>>\"),\n PATTERNS(\"php\",\n \t \"^[\\t ]*(((public|protected|private|static)[\\t ]+)*function.*)$\\n\"\n-\t \"^[\\t ]*(class.*)$\",\n+\t \"^[\\t ]*((((final|abstract)[\\t ]+)?class|interface|trait).*)$\",\n \t /* -- */\n \t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n \t \"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+\"\n-- \n2.10.1 (Apple Git-78)\n\n"},{"id":"351826","messageId":"xmqq36wwhvpg.fsf@gitster-ct.c.googlers.com","threadId":"48823","inReplyTo":"20180703131540.60789-2-dev@whileimautomaton.net","subject":"Re: [PATCH 1/2] t4018: add missing test cases for PHP","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-07-06T21:59:23Z","receivedAt":"2018-07-06T21:59:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kana Natsuno <dev@whileimautomaton.net> writes:\n\n> A later patch changes the built-in PHP pattern. These test cases\n> demonstrate aspects of the pattern that we do not want to change.\n>\n> Signed-off-by: Kana Natsuno <dev@whileimautomaton.net>\n> ---\n>  t/t4018/php-class    | 4 ++++\n>  t/t4018/php-function | 4 ++++\n>  t/t4018/php-method   | 7 +++++++\n>  3 files changed, 15 insertions(+)\n>  create mode 100644 t/t4018/php-class\n>  create mode 100644 t/t4018/php-function\n>  create mode 100644 t/t4018/php-method\n>\n> diff --git a/t/t4018/php-class b/t/t4018/php-class\n> new file mode 100644\n> index 0000000..7785b63\n> --- /dev/null\n> +++ b/t/t4018/php-class\n> @@ -0,0 +1,4 @@\n> +class RIGHT\n> +{\n> +    const FOO = 'ChangeMe';\n> +}\n> diff --git a/t/t4018/php-function b/t/t4018/php-function\n> new file mode 100644\n> index 0000000..35717c5\n> --- /dev/null\n> +++ b/t/t4018/php-function\n> @@ -0,0 +1,4 @@\n> +function RIGHT()\n> +{\n> +    return 'ChangeMe';\n> +}\n> diff --git a/t/t4018/php-method b/t/t4018/php-method\n> new file mode 100644\n> index 0000000..03af1a6\n> --- /dev/null\n> +++ b/t/t4018/php-method\n> @@ -0,0 +1,7 @@\n> +class Klass\n> +{\n> +    public static function RIGHT()\n> +    {\n> +        return 'ChangeMe';\n> +    }\n> +}\n\nI no longer speak PHP, and certainly not the modern variant, but\nthese examples all look good to me.  \n\nWhoever invented the convetion to use RIGHT/ChangeMe in t4018 should\nget praised---its brilliance shines in new tests like these ;-)\n\n\n"}]}