The underlying problem in Git is that commit-msg
hooks are not called for merge commits without conflicts.
However, the prepare-commit-msg
is called for (any) merge commits. So what I currently do to get Gerrit's Change-Id
also added to merge commits without conflicts is to use a prepare-commit-msg
hook like this:
#!/bin/sh
if [ "$2" = "merge" -a -f .git/MERGE_MSG ]; then
# Explicitly call Gerrit's commit-msg hook for merge commits.
.git/hooks/commit-msg "$1"
fi
The check for .git/MERGE_MSG
ensures that commit-msg
will not be called if amending a merge commit, because in that case that hook is called directly by Git anyway. Note that for merge commits with conflicts this approach will result in commit-msg
being called twice, once as part of this prepare-commit-msg
hook and once by Git when it calls commit-msg
after committing the conflicts resolution, but that does not cause any problems as Gerrit's commit-msg
hook checks whether the Change-Id
has already been added and does not add it again if that's the case.
If you're now asking your self why Gerrit does not simply use only a prepare-commit-msg
hook to add the Change-Id
, I guess that just to prevent the user from accidentally deleting the Change-Id
from the commit message. Adding it as part of a commit-msg
hook after the editor has closed is just safer.
http://stackoverflow.com/questions/19917025/why-does-gerrit-not-include-the-change-id-into-merge-commits
相关推荐
gerrit-rest-java-client, Gerrit代码审查的Java REST客户端 gerrit-rest-java-client 简介Gerrit代码审查工具 REST API的Java实现。仅支持 Gerrit 2.6或者更新版本的( 。旧版本中缺少/不完整的REST API ) 。
gerrit-rest-java-client 介绍 REST API的Java实现。 仅支持Gerrit 2.6或更高版本(旧版本中缺少/不完整的REST API)。 例如,此实现用作。 支持许多不同的身份验证方法(HTTP基本,HTTP摘要,带形式的LDAP,来自...
Gerrit的IDEA插件:gerrit-intellij-plugin-1.0.6-146
gerrit-intellij-plugin-1.2.6-203
gerrit-oauth-provider-v3.0.0.jar , 用于gerrit和keycloak整合使用的, 适合keycloak-4.8.3.Final.zip ,具体安装教程 https://yellowcong.blog.csdn.net/article/details/127108078
gerrit2.10 和bcpkix-jdk15on-152
Gerrit Code Review 搭建gerrit平台所需工具 官方最新版本
gerrit使用文档手册,适合新手学习gerrit
Leverage the power of Gerrit Code Review to make software development more cooperative and social Overview Understand the concepts of collective code review using Gerrit through a set of simple ...
gerrit-2.12.war,bcpkix-jdk15on-152.jar,bcprov-jdk15on-152.jar
gerrit-2.15-rc4.war,gerrit 最新稳定版本 gerrit 最新稳定版本
gerrit-stable-2.11.tar.gz gerrit-stable-2.11.tar.gz gerrit-stable-2.11.tar.gz gerrit-stable-2.11.tar.gz gerrit-stable-2.11.tar.gz gerrit-stable-2.11.tar.gz
gerrit服务器中用于查看代码的插件-gitiles
搭建gerrit服务器详细操作流程,有任何问题可以留言,互相提高
gerrit-hooks-例子 Gerrit 钩子示例
gerrit-2.11.10.wargerrit-2.11.10.wargerrit-2.11.10.war
来源:https://gerrit-review.googlesource.com/q/project:gerrit-fe-dev-helper #### v0.0.8-** BREAKN CHNAGE **:Gerrit正在迁移至`gr-app.js仅限`,因此`gr-app.html`将不再存在,我们还更新了默认规则以转发至`...
gerrit-change-trigger:Gerrit 变更触发器插件 添加一名作者 存储库: : 发布: : 概要 这是一个 Gerrit 插件。 这可以在 gerrit 事件流的更改中触发最新补丁patchset-created事件。 Trigger按钮被添加到修订...
gerrit-full-2.5.2.war 安装文件 详细安装过程可以参考 http://blog.csdn.net/zwhfyy/article/details/8662543 http://blog.csdn.net/zwhfyy/article/details/8663826