Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using gitolite VREFs for update hook

Tags:

git

gitolite

I am trying to migrate from v2 to v3 of gitolite. The old way of doing a server-side commit message check was to put the check in a repo specific hook in myrepo.git/hooks/update.secondary

In v3 of gitolite, they advise the check to be put in a VREF. The documentation is a little confusing and I am hoping for clarification.

I have added the following in /home/git/.gitolite.rc

LOCAL_CODE                  => "$ENV{HOME}/.gitolite/our_hooks",

In my our_hooks directory, I created a VREF folder and put my old update.secondary script in there. In my gitolite-admin/conf/gitolite.conf file, I added the following to the repository I want the script to execute on:

repo myrepo
  RW = @my_developers
  - VREF/update.secondary = @my_developers

When I try to push, I get a notice that the VREF/update.secondary can not be found. If I change to

repo myrepo
  RW = @my_developers
  - /home/git/.gitolite/our_hooks/VREF/update.secondary = @my_developers

I don't get any complaints but the hook doesn't appear to run at all.

Am I missing the boat on how to get an additional update check to run using gitolite?

like image 762
nathasm Avatar asked Oct 05 '22 16:10

nathasm


1 Answers

The documentation around this is a little confusing, so hopefully this will help others trying to get a chained update hook working with gitolite v3.

Everything I've done above is correct, the missing piece was were my update.secondary script needed to reside.

In the gitolite-admin/conf/gitolite.conf, the configuration should look like:

repo myrepo
  RW = @my_developers
  - VREF/update.secondary = @my_developers

Then there is a VREF directory in the GL_BINDIR directory. Place your executable update.secondary file in that directory.

The GL_BINDIR is the directory that contains the gitolite binary you ran in order to run: gitolite setup

like image 83
nathasm Avatar answered Oct 10 '22 02:10

nathasm