使用gitolite VREFs进行更新挂钩 [英] using gitolite VREFs for update hook

查看:148
本文介绍了使用gitolite VREFs进行更新挂钩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从v2迁移到gitolite的v3。执行服务器端提交消息检查的旧方法是将检查放在repo特定的钩子中myrepo.git / hooks / update.secondary



在v3 gitolite,他们建议将检查放入VREF。该文件有点混乱,我希望澄清。



我在/home/git/.gitolite.rc中添加了以下内容

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

在我的our_hooks目录中,我创建了一个VREF文件夹,并把我旧的update.secondary脚本在那里。在我的gitolite-admin / conf / gitolite.conf文件中,我将以下内容添加到我希望脚本执行的存储库中:

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

当我尝试推送时,我收到一条通知,指出无法找到VREF / update.secondary。如果我改成

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

我没有收到任何投诉,但挂钩似乎没有运行。



我错过了如何获得额外更新检查以使用gitolite运行吗?

解决方案

围绕这个文档有点令人困惑,所以希望这可以帮助其他人尝试使用gitolite v3获得链式更新挂钩。



上面所做的一切都是正确的,缺少的是我的update.secondary脚本需要驻留。



在gitolite -admin / conf / gitolite.conf,配置应该如下所示:

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

然后在GL_BINDIR中有一个VREF目录DIR ectory。将您的可执行文件update.secondary文件放在该目录中。



GL_BINDIR是包含运行gitolite二进制文件的目录: 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?

解决方案

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

这篇关于使用gitolite VREFs进行更新挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆