diff options
author | Junio C Hamano <junkio@cox.net> | 2007-04-21 03:14:13 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-04-24 22:38:51 -0700 |
commit | aa4ed402c9721170fde2e9e43c3825562070e65e (patch) | |
tree | bd53ad59439661046b506c7b42153bb3caeb9009 /t/t0021-conversion.sh | |
parent | Add 'ident' conversion. (diff) | |
download | tgif-aa4ed402c9721170fde2e9e43c3825562070e65e.tar.xz |
Add 'filter' attribute and external filter driver definition.
The interface is similar to the custom low-level merge drivers.
First you configure your filter driver by defining 'filter.<name>.*'
variables in the configuration.
filter.<name>.clean filter command to run upon checkin
filter.<name>.smudge filter command to run upon checkout
Then you assign filter attribute to each path, whose name
matches the custom filter driver's name.
Example:
(in .gitattributes)
*.c filter=indent
(in config)
[filter "indent"]
clean = indent
smudge = cat
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't/t0021-conversion.sh')
-rwxr-xr-x | t/t0021-conversion.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh index ad952c9ce2..bab9ecc34e 100755 --- a/t/t0021-conversion.sh +++ b/t/t0021-conversion.sh @@ -4,8 +4,17 @@ test_description='blob conversion via gitattributes' . ./test-lib.sh +cat <<\EOF >rot13.sh +tr '[a-zA-Z]' '[n-za-mN-ZA-M]' +EOF +chmod +x rot13.sh + test_expect_success setup ' + git config filter.rot13.smudge ./rot13.sh && + git config filter.rot13.clean ./rot13.sh && + { + echo "*.t filter=rot13" echo "*.i ident" } >.gitattributes && |