Skip to content

Commit

Permalink
Illustrate "filter" attribute with an example
Browse files Browse the repository at this point in the history
The example was taken from aa4ed40
(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>
  • Loading branch information
Nanako Shiraishi authored and Junio C Hamano committed Dec 15, 2009
1 parent 9861b64 commit d79f5d1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Documentation/gitattributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit d79f5d1

Please sign in to comment.