Skip to content

Commit 69f9c87

Browse files
ZoeBgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7ecec52 commit 69f9c87

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

Documentation/gitattributes.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,8 @@ patterns are available:
527527

528528
- `fortran` suitable for source code in the Fortran language.
529529

530+
- `fountain` suitable for Fountain documents.
531+
530532
- `html` suitable for HTML/XHTML documents.
531533

532534
- `java` suitable for source code in the Java language.

t/t4018-diff-funcname.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ diffpatterns="
3131
cpp
3232
csharp
3333
fortran
34+
fountain
3435
html
3536
java
3637
matlab

t/t4018/fountain-scene

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
EXT. STREET RIGHT OUTSIDE - DAY
2+
3+
CHARACTER
4+
You didn't say the magic phrase, "ChangeMe".

userdiff.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ IPATTERN("fortran",
3535
* they would have been matched above as a variable anyway. */
3636
"|[-+]?[0-9.]+([AaIiDdEeFfLlTtXx][Ss]?[-+]?[0-9.]*)?(_[a-zA-Z0-9][a-zA-Z0-9_]*)?"
3737
"|//|\\*\\*|::|[/<>=]="),
38+
IPATTERN("fountain", "^((\\.[^.]|(int|ext|est|int\\.?/ext|i/e)[. ]).*)$",
39+
"[^ \t-]+"),
3840
PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$",
3941
"[^<>= \t]+"),
4042
PATTERNS("java",

0 commit comments

Comments
 (0)