I'm having trouble running some scripts with the POST_CREATE hook on gitolite3.
I've red the documentation on non-core programms and how one can use the gitolite-admin repo to manage those. So far so good. So I went ahead and
Uncommented the LOCAL_CODE variable inside .gitolite.rc to point to a /local subfolder inside the gitolite-admin repo
LOCAL_CODE => "$rc{GL_ADMIN_BASE}/local",Added a script to run with the POST_CREATE hook
POST_CREATE => [ 'SetHead.sh', 'SetHead', 'local/SetHead.sh', 'local/SetHead', 'local/hooks/SetHead.sh', 'local/hooks/SetHead', 'local/hooks/common/SetHead.sh', 'local/hooks/common/SetHead', ],Ran gitolite setup --hooks-only
Created a new repository
Sadly the script doesn't seem to work or isn't even found? Any time I push the gitolite-admin repo to create a new repository I get the following warnings
remote: WARNING: skipped trigger 'SetHead.sh' (not found or not executable)
remote: WARNING: skipped trigger 'SetHead' (not found or not executable)
remote: WARNING: skipped trigger 'local/SetHead.sh' (not found or not executable)
remote: WARNING: skipped trigger 'local/SetHead' (not found or not executable)
remote: WARNING: skipped trigger 'local/hooks/SetHead.sh' (not found or not executable)
remote: WARNING: skipped trigger 'local/hooks/SetHead' (not found or not executable)
remote: WARNING: skipped trigger 'local/hooks/common/SetHead.sh' (not found or not executable)
remote: WARNING: skipped trigger 'local/hooks/common/SetHead' (not found or not executable)
/edit
Ok, apparently I got the paths wrong. The full path to the file on the server is
'/home/gitolite/.gitolite/local/hooks/common/SetHead.sh'
But this doesn't work either. Running the script directly on the server works as expected. I found a symlink to the script inside each repositories own hook folder. Does that mean it should work?
/edit2
Out of curiosity I've just put the script inside the /local/commands folder and enabled it by putting it's name in the ENABLE list in the .gitolite.rc file. For some reason this immediately worked...
Considering the documentation insists on providing the full path, I would test with:
LOCAL_CODE(without relying on$rcsubstitution)SetHead.shis in that path, with the same case (uper/lowercase)SetHead.shis executable (chmod 755)