【问题标题】:How to enable git multimail hook in gitolite如何在 gitolite 中启用 git multimail 钩子
【发布时间】:2014-06-28 08:41:09
【问题描述】:

我已经在我的服务器上克隆了 git-multimail 存储库,将 post-receivegit_multimail.py 符号链接到 ~/.gitolite/hooks/

然后跑gitolite setup --hooks-only

在我的gitolite-admin/conf/gitolite.conf 中我添加了:

repo gitolite-admin
   config multimailhook.environment = gitolite
   config multimailhook.mailingList = 'list@example.com'
   config multimailhook.refchangelist = user@example.com,user@example.com
   RW+     =   user

并在~/.gitolite.rc中启用:

GIT_CONFIG_KEYS                 =>  'multimail.*',

Sendmail 正在正确发送我的其他电子邮件。

我期待提交邮件,但没有任何反应。 如何调试?

我可以看到post-receive 中有一个选项可以启用对sys.stdout 的日志记录,但是在哪里可以看到日志?

【问题讨论】:

    标签: git githooks gitolite


    【解决方案1】:

    我刚刚添加了更多关于如何使用 gitolite 设置 git-multimail 的文档:https://github.com/git-multimail/git-multimail/blob/master/doc/gitolite.rst

    对于 git 2.7(2015 年第四季度),此设置过程将在 Git 源代码中的 git/git/contrib/hooks/multimail/doc/gitolite.rst 中进行描述。

    【讨论】:

      【解决方案2】:

      问题是放置钩子的实际目录(我用错了一个:.gitolite/hooks/

      此目录在.gitolite.rc 文件中控制,LOCAL_CODE 变量(默认注释)如下所述:http://gitolite.com/gitolite/gitolite.html#localcode

          # this one is managed directly on the server
          LOCAL_CODE                =>  "$ENV{HOME}/local",
      
          # or you can use this, which lets you put everything in a subdirectory
          # called "local" in your gitolite-admin repo.  For a SECURITY WARNING
          # on this, see http://gitolite.com/gitolite/cust.html#pushcode
          # LOCAL_CODE                =>  "$rc{GL_ADMIN_BASE}/local",
      

      这意味着,在注释掉默认变量设置后,您应该将您的钩子放在/home/git/local/hooks/common/ 中或启用 repo 特定的钩子,如.gitolite.rc 中所述,设置可执行权限并运行gitolite setup --hooks-only

      【讨论】:

      • 很好的反馈,+1。那将是我的下一个建议。
      猜你喜欢
      • 2012-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-12
      • 2011-08-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多