Tracking Gitolite (common) hooks in Git
git, githooks, gitolite
Solution
Those hooks can be added in your `gitolite-admin` repo (`gitolite-admin/hooks/common`) and push back to the Gitolite server. So they are versioned. (At least that was the case with Gitolite V2, I'll have to check with Gitolite V3)
It turns out, it does work, except the OP Rijk reports:
The problem was an error in my conf, that stopped the setup program. Commented out that line, and the triggers are installed properly
It was this line in my `gitolite.conf`:
config hooks.showrev = "git log -1 --name-status --format='%%h (%%ad) ------------------------------%%n%%n%%B' %s".
Don't know why, but triggered the following error:
FATAL: bad value 'git log -1 --name-status --format='%%h (%%ad) ------------------------------%%n%%n%%B' %s'.
Commented it out for now, will probably rewrite the `post-receive-email` script later on.
The OP Rijk's current solution:
The solution I currently have for this on Gitolite v3 is to:
- put things in `gitolite-admin/local-code/hooks/common`
- and then on the server put a full-path symlink to the relevant items within `$HOME/.gitolite/hooks/common`.
Problem
The only thing I found in Gitolite's manual on hooks, was: If you want to add your own hook, it's easy as long as it's not the 'update' hook. Just add it to $HOME/.gitolite/hooks/common and run gitolite setup. However, I would also like to track the changes made to these hooks, with the possibility to revert to an older version if needed (auditing functionality is cited as one of the big advantages of using Gitolite). So, basically, I was expecting something like having to add a `hooks` folder in my gitolite-admin clone, and then pushing the hooks to the server (like you do with the config or adding a public key). Does this make sense? Is it possible?