userdiff: add support for Fountain documents

Add support for Fountain, a plain text screenplay format. Git facilitates not just programming specifically, but creative writing in general, so it makes sense to also support other plain text documents besides source code. In the structure of a screenplay specifically, scenes are roughly analogous to functions, in the sense that it makes your job easier if you can see which ones were changed in a given range of patches. More information about the Fountain format can be found on its official website, at http://fountain.io . Signed-off-by: Zoë Blade <zoe@bytenoise.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Zoë Blade committed Jul 21, 2015 at 14:22 UTC 69f9c87d4654aad8011444727194c3053827ae07
4 files changed +9
Documentation/gitattributes.txt
+2
@@ -527,6 +527,8 @@ patterns are available:
527
528 - `fortran` suitable for source code in the Fortran language.
529
530 +- `fountain` suitable for Fountain documents.
531 +
532 - `html` suitable for HTML/XHTML documents.
533
534 - `java` suitable for source code in the Java language.
t/t4018-diff-funcname.sh
+1
@@ -31,6 +31,7 @@ diffpatterns="
31 cpp
32 csharp
33 fortran
34 + fountain
35 html
36 java
37 matlab
t/t4018/fountain-scene new
+4
@@ -0,0 +1,4 @@
1 +EXT. STREET RIGHT OUTSIDE - DAY
2 +
3 +CHARACTER
4 +You didn't say the magic phrase, "ChangeMe".
userdiff.c
+2
@@ -35,6 +35,8 @@ IPATTERN("fortran",
35 * they would have been matched above as a variable anyway. */
36 "|[-+]?[0-9.]+([AaIiDdEeFfLlTtXx][Ss]?[-+]?[0-9.]*)?(_[a-zA-Z0-9][a-zA-Z0-9_]*)?"
37 "|//|\\*\\*|::|[/<>=]="),
38 +IPATTERN("fountain", "^((\\.[^.]|(int|ext|est|int\\.?/ext|i/e)[. ]).*)$",
39 + "[^ \t-]+"),
40 PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$",
41 "[^<>= \t]+"),
42 PATTERNS("java",