0

I'm really confused about how to configure a GitLab global hook. The documentation is clear about how to set a global hook. So I login in my GitLab instance, go to the directory /opt/gitlab/embedded/service/gitlab-shell/hooks, and it has 3 files:

-rwxr-xr-x 1 root root 131 Jun 10 16:22 post-receive
-rwxr-xr-x 1 root root 131 Jun 10 16:22 pre-receive
-rwxr-xr-x 1 root root 131 Jun 10 16:22 update

All the files have the same content:

# cat pre-receive
#!/bin/sh
echo "The gitlab-shell hooks have been migrated to Gitaly, see https://gitlab.com/gitlab-org/gitaly/issues/1226"
exit 1

Since they all have a exit 1, clearly these hooks aren't being executed anymore.

The linked issue, is really confusing. It is a roadmap to implement something called Gitaly but I really don't see how to use it to implement global Git hooks.

Does anyone can show me the step by steps configuration of a git global hook in GitLab CE edition?

neves
  • 33,186
  • 27
  • 159
  • 192

1 Answers1

0

You are searching hooks inside gitlab-shell & Since they are moving many things from gitlab-shell to gitaly-ruby. So that means hooks are working somewhere from gitaly.

Now try this:

ls /opt/gitlab/embedded/service/gitaly-ruby/git-hooks

Hope you wont find any exit nonzero there. Rest is your art.

Mr. Pundir
  • 549
  • 6
  • 10
  • Could you give some more information about how to install a hook? Can you just add an additional script or you have to add my script to the already existing files? This is so confusing an undocumented. Thank you in advance, though. – Luca Foppiano Mar 24 '20 at 06:47