summaryrefslogtreecommitdiff
path: root/Documentation/gitattributes.txt
diff options
context:
space:
mode:
authorNanako Shiraishi <nanako3@lavabit.com>2009-12-15 03:11:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-12-15 06:04:30 (GMT)
commitd79f5d17189e70f8a98675a73663113776dcf4fe (patch)
tree155a875547a04e6f9c731f8ae33d88f57bdf8db0 /Documentation/gitattributes.txt
parent9861b644e045b5ee0e16dea65b44419205090960 (diff)
downloadgit-d79f5d17189e70f8a98675a73663113776dcf4fe.zip
git-d79f5d17189e70f8a98675a73663113776dcf4fe.tar.gz
git-d79f5d17189e70f8a98675a73663113776dcf4fe.tar.bz2
Illustrate "filter" attribute with an example
The example was taken from aa4ed402c9721170fde2e9e43c3825562070e65e (Add 'filter' attribute and external filter driver definition). Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/gitattributes.txt')
-rw-r--r--Documentation/gitattributes.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 1f472ce..5a45e51 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -197,6 +197,25 @@ intent is that if someone unsets the filter driver definition,
or does not have the appropriate filter program, the project
should still be usable.
+For example, in .gitattributes, you would assign the `filter`
+attribute for paths.
+
+------------------------
+*.c filter=indent
+------------------------
+
+Then you would define a "filter.indent.clean" and "filter.indent.smudge"
+configuration in your .git/config to specify a pair of commands to
+modify the contents of C programs when the source files are checked
+in ("clean" is run) and checked out (no change is made because the
+command is "cat").
+
+------------------------
+[filter "indent"]
+ clean = indent
+ smudge = cat
+------------------------
+
Interaction between checkin/checkout attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^