硬石膏钩不执行 [英] Gitolite hooks do not execute

查看:83
本文介绍了硬石膏钩不执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个脚本,以在推送发生后将回购文件更改为新的组.为了测试钩子,我创建了一个钩子,该钩子在/tmp/中创建了一个文件,仅用于检查钩子是否正常工作.但是不是.

I'm attempting to create a script to chmod the repo files to a new group after a push occurs. To test hooks, I created a hook that creates a file in /tmp/ just to check that the hook is working. It is not however.

到目前为止,我所做的是:
首先,我创建了一个脚本(〜/.gitolite/hooks/common/update.secondary),然后运行了gl-setup [pubkey].经过无数次尝试之后,我检查了主钩子目录(/var/gitolite/hook/common/),但脚本不存在.

What I've done so far:
First I created a script (~/.gitolite/hooks/common/update.secondary), then ran gl-setup [pubkey]. After numerous tries doing this, I checked the main hooks directory (/var/gitolite/hook/common/) and the script was not there.

之后,我将脚本直接放在/var/gitolite/hook/common/中,再次运行gl-setup,但它仍然没有运行该钩子.

After that I put the script directly in /var/gitolite/hook/common/, ran gl-setup again, and it still did not run the hook.

使用

sh ~/repositories/[some project]/hooks/myscript

我正在使用的脚本:

#!/bin/bash
touch /tmp/TESTFILE

权限更新脚本:

#!/bin/bash
chmod 750 -R /home/git/repositories/*

推荐答案

OP Jason Kaczmarsky 提到:

  • 直接将脚本放入/var/gitolite/hook/common/
  • chmod + x之前说过脚本
  • 运行gl-setup

有效并且确实传播了该脚本.

works and does propagate that script.

在Gitolite手册页"使用钩子",但这取决于安装方法,该安装方法似乎是在此处植根.

The first alternative mentioned by the OP is described in Gitolite man page "Using Hooks", but it depends on the installation method, which seems to be the root one here.

话虽如此,关于chmod操作,您需要考虑 gitolite.rc 中的变量REPO_UMASK,如下所述:

That being said, regarding chmod operation, you need to take into account the variable REPO_UMASK in your gitolite.rc, as explained in:

  • "gitolite and file permissions"
  • "Permission problems with Git sharedRepository"
  • "Setting umask in Git / Gitolite"

这篇关于硬石膏钩不执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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