@matheusbsbs / matheus-bagliano / commits / d79f5d1718
Fork 0

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>

Nanako Shiraishi committed Dec 15, 2009 at 12:11 UTC d79f5d17189e70f8a98675a73663113776dcf4fe
1 file changed +19
Documentation/gitattributes.txt
+19
@@ -197,6 +197,25 @@ intent is that if someone unsets the filter driver definition,
197 or does not have the appropriate filter program, the project
198 should still be usable.
199
200 +For example, in .gitattributes, you would assign the `filter`
201 +attribute for paths.
202 +
203 +------------------------
204 +*.c filter=indent
205 +------------------------
206 +
207 +Then you would define a "filter.indent.clean" and "filter.indent.smudge"
208 +configuration in your .git/config to specify a pair of commands to
209 +modify the contents of C programs when the source files are checked
210 +in ("clean" is run) and checked out (no change is made because the
211 +command is "cat").
212 +
213 +------------------------
214 +[filter "indent"]
215 + clean = indent
216 + smudge = cat
217 +------------------------
218 +
219
220 Interaction between checkin/checkout attributes
221 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^