如何在gitolite中安装钩子 [英] How to install hooks in gitolite

查看:97
本文介绍了如何在gitolite中安装钩子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读所有有关挂钩的文档类似 问题很多代码,但我无法追踪我的程序中的错误。我需要在我的gitolite安装中安装一个简单的钩子(在CentOS上使用rpm包进行安装),所以这就是我所做的:



安装gitolite(前一段时间) :
$ b $ ol

  • 安装rpm包
  • #su - gitolite
  • code>
  • $ gl-setup /tmp/fabio.pub (作为gitolite用户)



  • $ b

    现在安装钩子:


    1. 创建一个示例文件> post-update ,其中的钩子代码位于〜gitolite / .gitolite / hooks / common chmod + x 就可以了

    2. 运行 gl-setup /tmp/fabio.pub 再次作为在此陈述

    但没有任何事情发生,最新命令的退出状态为0,但钩子文件未在任何存储库中进行符号链接。那么我的程序有什么问题?我错过了什么?



    奖金问题:


    1. 如果我理解了doc我的程序是正确的吗?即我应该在每次更新任何钩子时运行gl-setup?

    2. 通过这种方式,我在每个存储库中安装共享钩子,是吗?我是否可以手动安装一个钩子,或者作为符号链接到某个地方,或者仅仅是一个可执行脚本,仅用于给定的存储库?我应该在给定存储库的hook文件夹中手动执行此操作吗?我应该关心钩子是否发生冲突(例如,单个存储库的任何自定义钩子是否会阻止具有相同名称的任何其他共享钩子)?

    不知道这是否重要,我的gitolite版本是 1.5.9.1

    解决方案

    我刚发现如果我在 / usr / share / gitolite / hooks / common / 中复制我的钩子示例,它将被 GL-设置。也许在这个包中 $ GL_ADMINDIR 变量没有被设置。两个奖金问题仍然存在......


    I've read all the documentation about hooks, similar questions and a lot of code but I can't track where is the error in my procedure. I need to install a simple hook in my gitolite installation (made with an rpm package on CentOS) so here is what I did:

    To install gitolite (some time ago):

    1. Installed the rpm package
    2. # su - gitolite
    3. $ gl-setup /tmp/fabio.pub (as gitolite user)

    Now to install the hook:

    1. Created a sample file post-update with the hook code in ~gitolite/.gitolite/hooks/common and chmod +x on it
    2. run gl-setup /tmp/fabio.pub again as stated here

    But nothing happened, the exit status from the latest command is 0, but the hook file is not symlinked in any of the repository. So what's wrong with my procedure? Have I missed something?

    Bonus questions:

    1. If I had understood the doc my procedure is the right one? I.e. should I run gl-setup every time I update any hook?
    2. In this way I install the shared hooks in every repository under this gitolite installation, is that right? Can I manually install an hook either as symlink to somewhere or just an executable script only for a given repository? Should I do that manually in the hook folder of the given repository? Should I care of hooks conflicts (i.e. would any custom hook for the single repository block any other shared hook with the same name)?

    Don't know if this matters, my gitolite version is 1.5.9.1.

    解决方案

    I just found out that if I copy my hook sample in /usr/share/gitolite/hooks/common/ it will be symlinked by gl-setup. Maybe in this package $GL_ADMINDIR variable is not set for some reason. Two bonus questions still stands...

    这篇关于如何在gitolite中安装钩子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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