问题描述
在我的.gitolite.rc
文件中,我有:
LOCAL_CODE => "$ENV{HOME}/.gitolite/local"
.. then在我已启用的同一文件的ENABLE
部分中repo-specific-hooks
:
..then in ENABLE
section of the same file I have enabledrepo-specific-hooks
:
ENABLE => [
# COMMANDS
# These are the commands enabled by default
'help',
'desc',
'info',
...,
...,
...,
'repo-specific-hooks'
...,
...,
...
]
现在,在我的本地计算机上的gitolite-admin
文件夹中,我拥有:
, now, on my local machine inside gitolite-admin
folder I have:
gitolite-admin
...
...
└──local/
└── hooks/
├── common/
└── repo-specific/
└── message* <-- this one I want to call in a post-receive hook!
,并在我的gitolite-admin
conf文件中进行一些回购:
, and for some repo in my gitolite-admin
conf file:
repo foo
RW+ = @all
option hook.post-receive = message <-- referencing script I want to call on post-receive
我从gitolite-admin
进行了commit
和push
,我可以看到我的message
脚本已部署在服务器路径上应放置的位置($ ENV {HOME}/.gitolite/local) ,并设置了可执行的权限.
I did commit
and push
, from gitolite-admin
and I can see that my message
script got deployed where it should be on the server path ( that $ENV{HOME}/.gitolite/local ), with executable permsission set.
但是,当我按下repo foo
时,没有收到来自我的回显消息message
脚本,它只是一个bash脚本:
However, when I push to repo foo
I don't get echoed message from mymessage
script, which simply is a bash script:
echo "hello from message"
exit 0
为什么post-receive
没有触发?
如果我理解得很好,则该foo repo
中应该有一个符号链接叫post-receive
指向我的message
脚本,但没有一个.
Also if I understood well, there should be a symbolic link in that foo repo
called post-receive
pointing to my message
script, and there isn't one.
推荐答案
正如OP所确认的那样,每个回购挂钩仅可从3.5晚(2013年10月),2014年3.6日(2014年)而不是3.5.x早期的gitolite获得. (2013).
As confirmed by the OP, the per repo hook is only available from gitolite late 3.5 (Oct /2013), 3.6 (2014), not early 3.5.x (2013).
'repo-specific-hooks
'是:
- 在提交62fb317 (gitolite 3.5.3,2013年10月) 中引入 >
- 以前在提交c0e36b3 (gitolite 3.6,2014年5月) 中进行了测试
- 在提交b607f55 (gitolite 3.6.1,2014年6月23日)中进行调试
- introduced in commit 62fb317 (gitolite 3.5.3, Oct 2013)
- formerly tested in commit c0e36b3 (gitolite 3.6, May 2014)
- debugged in commit b607f55 (gitolite 3.6.1, June 23d 2014)
因此,这里需要最新版本的gitolite.
So the very latest version of gitolite is needed here.
这篇关于凹凸棒石接收后钩未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!