如何让 Gerrit 的代码审查在成功提交时输出电子邮件差异?
现在它只是显示:
M test.txt
1 file changed, 1 insertion(+), 0 deletions(-)
以前我们使用 git-commit-notifier 来获得漂亮的颜色当我们使用 Gitolite 时,我们的开发人员邮件列表中存在差异(这是一个接收后挂钩)。
我可以在 Gerrit 实例中进行相同的设置,但随后我们将使用两种不同的邮件机制、电子邮件模板和成功合并时的双电子邮件。
Right now it just shows:
M test.txt
1 file changed, 1 insertion(+), 0 deletions(-)
Previously we used git-commit-notifier to have nice colored diffs in our developer mailing list (this is a post-receive hook) when we were using Gitolite.
I could set it up the same in the Gerrit instance but then we'd be using two different mail mechanisms, email templates, and double emails on successful merges.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
目前看来无法使用标准的 gerrit 电子邮件或电子邮件模板。
Gal Hammer 在此线程中提出了一个补丁:http://groups.google.com/group/repo-discuss/browse_thread/thread/fa514efd491703d8/c0c1762d3fdd1588 但目前尚未合并到主干中。
我认为它甚至没有按照标准补丁提交流程提交,因此可能需要一段时间才能有人获取该代码并将其推送到主干。
您可以查看 Mauvis Ledford 的答案以获取替代解决方案。
It looks like currently it's not possible using the standard gerrit e-mails or e-mail templates.
Gal Hammer proposed a patch in this thread: http://groups.google.com/group/repo-discuss/browse_thread/thread/fa514efd491703d8/c0c1762d3fdd1588 but it's not currently merged into trunk.
I think it's not even submitted following the standard patch submit process so it can take a while before somebody takes that code and pushes it to trunk.
You can see the Mauvis Ledford answer for an alternative solution.
从 Gerrit 2.6 开始,可以使“更改合并”通知电子邮件包含提交的统一差异。
https://gerrit-review.googlesource.com/#/c/39725/
From Gerrit 2.6 it will be possible to make the "change merged" notification email include the commit's unified diff.
https://gerrit-review.googlesource.com/#/c/39725/
该项目的开发人员 Sean Pearce 在 Google 网上论坛回答了我的问题。他建议插入服务器上的更改合并挂钩:
http://gerrit.googlecode.com/svn/documentation/2.2.0/config-hooks.html#_change_merged
然后,使用 git-commit-notifier 作为回调。
Sean Pearce, a developer on the project answered my question on Google Groups. He suggested plugging into the change-merged hook on your server:
http://gerrit.googlecode.com/svn/documentation/2.2.0/config-hooks.html#_change_merged
Then, as the callback use git-commit-notifier.