{"thread":{"id":"39891","subject":"[PATCH] userdiff: add support for Fountain documents","startedAt":"2015-07-19T12:31:22Z","lastAt":"2015-07-21T13:23:04Z","messageCount":3,"participants":["Zoë Blade","Junio C Hamano","Zoë Blade"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"266376","messageId":"1437309082-19060-1-git-send-email-zoe@bytenoise.co.uk","threadId":"39891","inReplyTo":null,"subject":"[PATCH] userdiff: add support for Fountain documents","fromName":"Zoë Blade","fromEmail":"zoe@bytenoise.co.uk","sentAt":"2015-07-19T12:31:22Z","receivedAt":"2015-07-19T12:31:22Z","isPatch":true,"sender":{"key":"zoe@bytenoise.co.uk","avatar":"https://avatars.githubusercontent.com/u/502434?v=4"},"body":"Add support for Fountain, a plain text screenplay format.  Git\nfacilitates not just programming specifically, but creative writing\nin general, so it makes sense to also support other plain text\ndocuments besides source code.\n\nIn the structure of a screenplay specifically, scenes are roughly\nanalogous to functions, in the sense that it makes your job easier\nif you can see which ones were changed in a given range of patches.\n\nMore information about the Fountain format can be found on its\nofficial website, at http://fountain.io .\n\nSigned-off-by: Zoë Blade <zoe@bytenoise.co.uk>\n---\n Documentation/gitattributes.txt | 2 ++\n t/t4018-diff-funcname.sh        | 1 +\n t/t4018/fountain-scene          | 4 ++++\n userdiff.c                      | 2 ++\n 4 files changed, 9 insertions(+)\n create mode 100644 t/t4018/fountain-scene\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex 81fe586..e3b1de8 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -527,6 +527,8 @@ patterns are available:\n \n - `fortran` suitable for source code in the Fortran language.\n \n+- `fountain` suitable for Fountain documents.\n+\n - `html` suitable for HTML/XHTML documents.\n \n - `java` suitable for source code in the Java language.\ndiff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh\nindex 1dbaa38..67373dc 100755\n--- a/t/t4018-diff-funcname.sh\n+++ b/t/t4018-diff-funcname.sh\n@@ -31,6 +31,7 @@ diffpatterns=\"\n \tcpp\n \tcsharp\n \tfortran\n+\tfountain\n \thtml\n \tjava\n \tmatlab\ndiff --git a/t/t4018/fountain-scene b/t/t4018/fountain-scene\nnew file mode 100644\nindex 0000000..6b3257d\n--- /dev/null\n+++ b/t/t4018/fountain-scene\n@@ -0,0 +1,4 @@\n+EXT. STREET RIGHT OUTSIDE - DAY\n+\n+CHARACTER\n+You didn't say the magic phrase, \"ChangeMe\".\ndiff --git a/userdiff.c b/userdiff.c\nindex 2ccbee5..5a600d6 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -35,6 +35,8 @@ IPATTERN(\"fortran\",\n \t  * they would have been matched above as a variable anyway. */\n \t \"|[-+]?[0-9.]+([AaIiDdEeFfLlTtXx][Ss]?[-+]?[0-9.]*)?(_[a-zA-Z0-9][a-zA-Z0-9_]*)?\"\n \t \"|//|\\\\*\\\\*|::|[/<>=]=\"),\n+PATTERNS(\"fountain\", \"^((\\\\.|(([Ii][Nn][Tt]|[Ee][Ss][Tt]|[Ee][Xx][Tt])?\\\\.?|[Ii]([Nn][Tt])?\\\\.?/[Ee]([Xx][Tt])?\\\\.?) ).+)$\",\n+\t \"[^ \\t-]+\"),\n PATTERNS(\"html\", \"^[ \\t]*(<[Hh][1-6][ \\t].*>.*)$\",\n \t \"[^<>= \\t]+\"),\n PATTERNS(\"java\",\n-- \n2.5.0.rc2.28.g6003e7f.dirty\n"},{"id":"266519","messageId":"xmqqegk2y1dm.fsf@gitster.dls.corp.google.com","threadId":"39891","inReplyTo":"1437309082-19060-1-git-send-email-zoe@bytenoise.co.uk","subject":"Re: [PATCH] userdiff: add support for Fountain documents","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-20T21:17:57Z","receivedAt":"2015-07-20T21:17:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Zoë Blade <zoe@bytenoise.co.uk> writes:\n\n> diff --git a/userdiff.c b/userdiff.c\n> index 2ccbee5..5a600d6 100644\n> --- a/userdiff.c\n> +++ b/userdiff.c\n> @@ -35,6 +35,8 @@ IPATTERN(\"fortran\",\n>  \t  * they would have been matched above as a variable anyway. */\n>  \t \"|[-+]?[0-9.]+([AaIiDdEeFfLlTtXx][Ss]?[-+]?[0-9.]*)?(_[a-zA-Z0-9][a-zA-Z0-9_]*)?\"\n>  \t \"|//|\\\\*\\\\*|::|[/<>=]=\"),\n> +PATTERNS(\"fountain\", \"^((\\\\.|(([Ii][Nn][Tt]|[Ee][Ss][Tt]|[Ee][Xx][Tt])?\\\\.?|[Ii]([Nn][Tt])?\\\\.?/[Ee]([Xx][Tt])?\\\\.?) ).+)$\",\n> +\t \"[^ \\t-]+\"),\n\nWouldn't IPATTERN() be a better choice here?\n\n>  PATTERNS(\"html\", \"^[ \\t]*(<[Hh][1-6][ \\t].*>.*)$\",\n>  \t \"[^<>= \\t]+\"),\n>  PATTERNS(\"java\",\n"},{"id":"266540","messageId":"F67D2953-FCA5-43F8-A370-13C77B14553B@bytenoise.co.uk","threadId":"39891","inReplyTo":"xmqqegk2y1dm.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] userdiff: add support for Fountain documents","fromName":"Zoë Blade","fromEmail":"zoe@bytenoise.co.uk","sentAt":"2015-07-21T13:23:04Z","receivedAt":"2015-07-21T13:23:04Z","isPatch":true,"sender":{"key":"zoe@bytenoise.co.uk","avatar":"https://avatars.githubusercontent.com/u/502434?v=4"},"body":"On 20 Jul 2015, at 22:17, Junio C Hamano <gitster@pobox.com> wrote:\n\n>> +PATTERNS(\"fountain\", \"^((\\\\.|(([Ii][Nn][Tt]|[Ee][Ss][Tt]|[Ee][Xx][Tt])?\\\\.?|[Ii]([Nn][Tt])?\\\\.?/[Ee]([Xx][Tt])?\\\\.?) ).+)$\",\n>> +\t \"[^ \\t-]+\"),\n> \n> Wouldn't IPATTERN() be a better choice here?\n\nGood point, thank you!  Much better:\n\nIPATTERN(\"fountain\", \"^((\\\\.|((int|est|ext)?\\\\.?|i(nt)?\\\\.?/e(xt)?\\\\.?) ).+)$\", \"[^ \\t-]+\"),\n\nIt looks like some of the others might benefit from being case insensitive too, but I'm not sure, and at any rate it would warrant a separate patch.\n\nI'll send another revision next... :)\n\nThanks,\nZoë."}]}