Illustrate "filter" attribute with an example
The example was taken from aa4ed402c9
(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>
This commit is contained in:
parent
9861b644e0
commit
d79f5d1718
@ -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
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
Loading…
Reference in New Issue
Block a user