Gitolite hooks do not execute

為{幸葍}努か 提交于 2019-12-23 04:15:16

问题


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.

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.

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

The script executes fine as the gitolite user using

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

The script I'm using:

#!/bin/bash
touch /tmp/TESTFILE

The permission update script:

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

回答1:


The OP Jason Kaczmarsky mentions that:

  • putting the script directly in /var/gitolite/hook/common/
  • chmod+x said script before
  • running gl-setup

works and does propagate that script.

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.

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"


来源:https://stackoverflow.com/questions/10109219/gitolite-hooks-do-not-execute

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!