userdiff: add support for Fountain documents
authorZoë Blade <zoe@bytenoise.co.uk>
Tue, 21 Jul 2015 13:22:46 +0000 (14:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Jul 2015 21:44:51 +0000 (14:44 -0700)
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>
Documentation/gitattributes.txt
t/t4018-diff-funcname.sh
t/t4018/fountain-scene [new file with mode: 0644]
userdiff.c
index 81fe586948582fae4945029a5cd49e61b09fac5b..e3b1de80335e713507875fb54c31c3ba5dab8c9f 100644 (file)
@@ -527,6 +527,8 @@ patterns are available:
 
 - `fortran` suitable for source code in the Fortran language.
 
+- `fountain` suitable for Fountain documents.
+
 - `html` suitable for HTML/XHTML documents.
 
 - `java` suitable for source code in the Java language.
index 1dbaa3864a568e09c30c174f771d593beeb1284d..67373dc44ef18ae4c58f237ed9f5c7610ec6413c 100755 (executable)
@@ -31,6 +31,7 @@ diffpatterns="
        cpp
        csharp
        fortran
+       fountain
        html
        java
        matlab
diff --git a/t/t4018/fountain-scene b/t/t4018/fountain-scene
new file mode 100644 (file)
index 0000000..6b3257d
--- /dev/null
@@ -0,0 +1,4 @@
+EXT. STREET RIGHT OUTSIDE - DAY
+
+CHARACTER
+You didn't say the magic phrase, "ChangeMe".
index 2ccbee50cb69171062e84c9a1b36baf7e31be2f8..6bf2505994b1d1054604b84d49faeb45eb6a9534 100644 (file)
@@ -35,6 +35,8 @@ IPATTERN("fortran",
          * they would have been matched above as a variable anyway. */
         "|[-+]?[0-9.]+([AaIiDdEeFfLlTtXx][Ss]?[-+]?[0-9.]*)?(_[a-zA-Z0-9][a-zA-Z0-9_]*)?"
         "|//|\\*\\*|::|[/<>=]="),
+IPATTERN("fountain", "^((\\.[^.]|(int|ext|est|int\\.?/ext|i/e)[. ]).*)$",
+        "[^ \t-]+"),
 PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$",
         "[^<>= \t]+"),
 PATTERNS("java",