Can I create symlink from some folder to .git/custom_hooks/? If not, why?
In what order are hooks from .git/custom_hooks/<hook_name>.d/* and .git/hooks/<hook_name>.d/* run?
Where I should create global custom hooks? Documentation says about: .git/hooks/<hook_name>.d/. In /opt/gitlab/embedded/service/gitlab-shell/hooks/<hook_name>.d/? If I create them here, won’t next GitLab upgrade overwrite them?
I’d like to create one location with many scripts run in loop as different hooks (just like in this solution http://stackoverflow.com/questions/8730514/chaining-git-hooks/8734391#8734391) and in each project make custom_hooks folder as a symlink from that earlier mentioned location. And I’d like to make it only for few groups (it would be automated by system hooks for new projects), no for every project (as global custom hooks).
Where I should create global custom hooks? Documentation says about: .git/hooks/.d/. In /opt/gitlab/embedded/service/gitlab-shell/hooks/.d/? If I create them here, won’t next GitLab upgrade overwrite them?
It should be: /opt/gitlab/embedded/service/gitlab-shell/hooks/pre-receive.d/ (or update/post-receive). I thought I was reading that there is a mechanism to prevent the hooks from being removed on upgrades, but I can’t find that text now, so I can’t confirm on that.
@arunkumar
You should create folder /opt/gitlab/embedded/service/gitlab-shell/hooks/pre-receive.d/ and create there any hook file. Of course user gitlab should be able to execute it.