diff options
author | Petr Onderka <gsvick@gmail.com> | 2010-09-01 00:42:43 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-01 12:19:36 -0700 |
commit | 6df42ab98480dcac473ca7d701cfca4a0051d0c1 (patch) | |
tree | 7b0f2000cf0d92335e966838eb77bb37f09f51d9 /t/t0003-attributes.sh | |
parent | 64fdc08dac6694d1e754580e7acb82dfa4988bb9 (diff) | |
download | git-6df42ab98480dcac473ca7d701cfca4a0051d0c1.tar.gz |
Add global and system-wide gitattributes
Allow gitattributes to be set globally and system wide. This way, settings
for particular file types can be set in one place and apply for all user's
repositories.
The location of system-wide attributes file is $(prefix)/etc/gitattributes.
The location of the global file can be configured by setting
core.attributesfile.
Some parts of the code were copied from the implementation of the same
functionality in config.c.
Signed-off-by: Petr Onderka <gsvick@gmail.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0003-attributes.sh')
-rwxr-xr-x | t/t0003-attributes.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index 53bd7fcc4a..a7e24edf5b 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -36,6 +36,9 @@ test_expect_success 'setup' ' echo "d/* test=a/b/d/*" echo "d/yes notest" ) >a/b/.gitattributes + ( + echo "global test=global" + ) >$HOME/global-gitattributes ' @@ -57,6 +60,16 @@ test_expect_success 'attribute test' ' ' +test_expect_success 'core.attributesfile' ' + attr_check global unspecified && + git config core.attributesfile "$HOME/global-gitattributes" && + attr_check global global && + git config core.attributesfile "~/global-gitattributes" && + attr_check global global && + echo "global test=precedence" >> .gitattributes && + attr_check global precedence +' + test_expect_success 'attribute test: read paths from stdin' ' cat <<EOF > expect |