Gitlab 12.X - problem with global Git hooks

Starting with gitlab 12.0, the structure of the data repositories is now hashed.

I have noticed that global git hooks do not seem to work as it used to be anymore.

A repository used to be stored as
/var/opt/gitlab/git-data/repositories/<group>/<project>.git, with
/var/opt/gitlab/git-data/repositories/<group>/<project>.git/hooks being a symbolic link to /opt/gitlab/embedded/service/gitlab-shell/hooks

With the new hashed structure, I notice that the new structure is as follow
and “hooks” is now a folder, not a symbolic link to /opt/gitlab/embedded/service/gitlab-shell/hooks
Is this a bug ?

Also, the documentation does not seem up to date as it still refers to groups and project in the data structure.

So , is it still possible to setup a global git hook on the server side ?


The behaviour was found in 12.0.3
The same behaviour has been found in 12.1.3
I haven’t teste 12.2 version yet. However, it does not seem to be mentionned in the release notes.

I had an answer from Gitlab team via

The symbolic links are no longer created. Instead, the location of the hook is used directly.

You just need to update /etc/gitlab/gitlab.rb with the line :
gitlab_shell[‘custom_hooks_dir’] = “/opt/gitlab/embedded/service/gitlab-shell/hooks”`

and then run “gitlab-ctl reconfigure”