gpt4 book ai didi

git - 在 Git 中跟踪 Gitolite(常见)钩子(Hook)

转载 作者:太空狗 更新时间:2023-10-29 13:32:45 25 4
gpt4 key购买 nike

我在 Gitolite 的 manual 中找到的唯一东西在钩子(Hook)上,是:

If you want to add your own hook, it's easy as long as it's not the 'update' hook. Just add it to $HOME/.gitolite/hooks/common and run gitolite setup.

但是,我还想跟踪对这些 Hook 所做的更改,并在需要时恢复到旧版本(审计功能是 cited 的一大优势)使用 Gitolite)。所以,基本上,我期待的是必须在我的 gitolite-admin 克隆中添加一个 hooks 文件夹,然后将 Hook 推送到服务器(就像你对配置或添加公钥所做的那样) .

这有意义吗?可能吗?

最佳答案

这些钩子(Hook)可以添加到您的 gitolite-admin 存储库中(gitolite-admin/hooks/common)并推送回 Gitolite 服务器。
所以它们是版本化的。 (至少 Gitolite V2 是这样,我将不得不检查 Gitolite V3)


事实证明,它确实有效,除了 OP Rijk报告:

The problem was an error in my conf, that stopped the setup program.
Commented out that line, and the triggers are installed properly

It was this line in my gitolite.conf:

config hooks.showrev = "git log -1 --name-status --format='%%h (%%ad) ------------------------------%%n%%n%%B' %s". 

Don't know why, but triggered the following error:

FATAL: bad value 'git log -1 --name-status --format='%%h (%%ad) ------------------------------%%n%%n%%B' %s'. 

Commented it out for now, will probably rewrite the post-receive-email script later on.


OP Rijk的当前解决方案:

The solution I currently have for this on Gitolite v3 is to:

  • put things in gitolite-admin/local-code/hooks/common
  • and then on the server put a full-path symlink to the relevant items within $HOME/.gitolite/hooks/common.

关于git - 在 Git 中跟踪 Gitolite(常见)钩子(Hook),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10414887/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com