Skip to content

Make git hooks self healing

Zeger-Jan van de Weg requested to merge zj-self-healing-hooks into master

If the git hooks aren't symlinked properly, GitLab authentication and authorization is skipped completely. So on most Git operations, if these hooks are missing this commit will try to repair them when triggering an upload-pack, or receive-pack git action.

The hooks.SetGitLabHooks() method is idempotent, meaning it will work correctly in the case where the hooks are set properly.

Also, setting the hooks like this will allow the Gitaly team to, at some point, change the location of the Git hooks without migrating them in one big swoop.

The open question I struggled with; where should these hooks be added and where can we skip them? Is the current subset good enough?

Part of #1226 (closed)

Edited by Zeger-Jan van de Weg

Merge request reports