[PATCH] userdiff: add support for Fountain documents
From: Zoë Blade <hidden>
Date: 2016-06-15 23:05:46
Add support for Fountain, a plain text screenplay format. In the structure of a screenplay, scenes are roughly analogous to functions, in the sense that it makes your job slightly easier if you can see which ones were changed in a given range of patches. --- Documentation/gitattributes.txt | 2 ++ t/t4018-diff-funcname.sh | 1 + t/t4018/fountain-scene | 4 ++++ userdiff.c | 2 ++ 4 files changed, 9 insertions(+) create mode 100644 t/t4018/fountain-scene
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 81fe586..e3b1de8 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt@@ -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.
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 1dbaa38..67373dc 100755
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh@@ -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
index 0000000..6b3257d
--- /dev/null
+++ b/t/t4018/fountain-scene@@ -0,0 +1,4 @@ +EXT. STREET RIGHT OUTSIDE - DAY + +CHARACTER +You didn't say the magic phrase, "ChangeMe".
diff --git a/userdiff.c b/userdiff.c
index 2ccbee5..5316b48 100644
--- a/userdiff.c
+++ b/userdiff.c@@ -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_]*)?" "|//|\\*\\*|::|[/<>=]="), +PATTERNS("fountain", "^((INT|EST|EXT)?\\.[A-Z0-9' -]+)$", + "[^ \t-]+"), PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$", "[^<>= \t]+"), PATTERNS("java",
--
2.5.0.rc2.28.g6003e7f.dirty