Reputation: 19176
I've read all the documentation about hooks, similar questions and a lot of code but I can't track where is the error in my procedure. I need to install a simple hook in my gitolite installation (made with an rpm package on CentOS) so here is what I did:
To install gitolite (some time ago):
# su - gitolite
$ gl-setup /tmp/fabio.pub
(as gitolite user)Now to install the hook:
post-update
with the hook code in ~gitolite/.gitolite/hooks/common
and chmod +x
on itgl-setup /tmp/fabio.pub
again as stated hereBut nothing happened, the exit status from the latest command is 0, but the hook file is not symlinked in any of the repository. So what's wrong with my procedure? Have I missed something?
Bonus questions:
Don't know if this matters, my gitolite version is 1.5.9.1
.
Upvotes: 9
Views: 9353
Reputation: 50648
In Gitolite v3 you may choose where to put your hooks editing LOCAL_CODE
variable in .gitolite.rc
. See the file source for more options (eg. enabling per repo custom hooks)
Then you put your hooks in the specified dir, make them executable and run gitolite setup --hooks-only
.
Upvotes: 1
Reputation: 19176
I just found out that if I copy my hook sample in /usr/share/gitolite/hooks/common/
it will be symlinked by gl-setup
. Maybe in this package $GL_ADMINDIR
variable is not set for some reason. Two bonus questions still stands...
Upvotes: 0
Reputation: 129584
you need to add an update.secondary
hook in the directory then redeploy with gl-easyinstall. Take a look at the update hook that comes with gitolite. You will see that near the end, it calls update.secondary
. If you provide that, it will work.
Upvotes: 0