Some sites may already have been using update hooks in their existing (pre-Gitolite) repository setups. Since Gitolite reserves the update hook for itself, this presents a bit of a problem in terms of switching over.
If your site has such update hooks, the VREF mechanism can help replace them. Replacing update hooks is one of the simplest uses of VREFs, but understanding how that is done is also a good first step to understanding the full power of Gitolite's VREF mechanism.
To convert your existing update hooks to VREFs, you first create a directory called VREF within $HOME/local
(we're continuing the convention from Chapter 9, Customizing Gitolite, that the LOCAL_CODE
variable in the rc
file points here). Then, copy each unique update hook into this newly created directory, renaming each update hook in some way.
As an example, say you had one repository that was frequently worked on by novice users using Windows, and so the update hook was used to make sure there were...