also sprach Joey Hess <[email protected]> [2014-05-27 20:51 +0200]: > I assume you're talking about after git-annex sync in direct mode? > (Indirect mode just uses git checkout.)
No, I am talking about the default symlink method. And it really
does not seem to be using git-checkout:
% GIT_DIR=bare.git git --bare init --shared=group
Initialized empty shared Git repository in
/home/madduck/.tmp/cdt.7Y7ncs/bare.git/
% GIT_DIR=bare.git git annex init
init ok
(Recording state in git...)
% git clone bare.git working
Cloning into 'working'...
done.
% cd working
% printf "#\!/bin/sh\necho post-checkout: \"\$@\"\n" >
.git/hooks/post-checkout && chmod 700 .git/hooks/post-checkout
% touch a && git annex add a
add a ok
(Recording state in git...)
% git annex sync --content
(merging origin/git-annex into git-annex...)
(Recording state in git...)
commit ok
pull origin
ok
copy a copy a (to origin...) ok
pull origin
ok
(Recording state in git...)
push origin
Counting objects: 19, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (15/15), done.
Writing objects: 100% (19/19), 1.55 KiB | 0 bytes/s, done.
Total 19 (delta 5), reused 0 (delta 0)
To /home/madduck/.tmp/cdt.7Y7ncs/bare.git
* [new branch] git-annex -> synced/git-annex
* [new branch] master -> synced/master
ok
% ls -l
total 4
lrwxrwxrwx 1 madduck madduck 178 May 28 09:30 a ->
.git/annex/objects/pX/ZJ/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
% git annex drop a
drop a ok
(Recording state in git...)
% git annex sync --content
commit ok
pull origin
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
From /home/madduck/.tmp/cdt.7Y7ncs/bare
fcd1b8a..7343ea7 git-annex -> origin/git-annex
ok
(merging origin/git-annex into git-annex...)
(Recording state in git...)
get a (from origin...) ok
pull origin
ok
(Recording state in git...)
push origin
Counting objects: 15, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (15/15), 1.18 KiB | 0 bytes/s, done.
Total 15 (delta 5), reused 0 (delta 0)
To /home/madduck/.tmp/cdt.7Y7ncs/bare.git
dbeb586..d23e314 git-annex -> synced/git-annex
ok
% git checkout HEAD
post-checkout: acbb6275b047482d149886b32fb704a652aa450c
acbb6275b047482d149886b32fb704a652aa450c 1
Note how the sync did not emit any output from the hook, while it
works with a plain checkout. Looking at debug output confirms this:
% git annex drop a
drop a ok
(Recording state in git...)
% git annex --debug sync --content 2>&1 | grep -c checkout
0
--
.''`. martin f. krafft <[email protected]> Related projects:
: :' : proud Debian developer http://debiansystem.info
`. `'` http://people.debian.org/~madduck http://vcs-pkg.org
`- Debian - when you have better things to do than fixing systems
digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)

