提交消息中的Change-Id丢失时Gerrit错误 [英] Gerrit error when Change-Id in commit messages are missing

查看:895
本文介绍了提交消息中的Change-Id丢失时Gerrit错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在远程仓库中建立了一个分支,并在该分支上进行了一些提交。
现在我想将远程分支合并到远程主服务器上。

基本上我的操作如下:


  • 结帐分支

  • 结帐主分页
  • 合并分支并修复合并错误
  • commit

  • push origin HEAD:refs / for / master

  • 第5步中的消息:

      remote:解析变化量:0%(0/12)

    remote:错误:缺少提交消息中的Change-Id
    ...

    remote:更改Id:I55862204ef71f69bc88c79fe2259f7cb8365699a

    到ssh:// prc @ test。 gerrit.xxx.com:29418/hello_git
    ! [远程拒绝] HEAD - > refs / for / master(在提交信息中缺少Change-Id)


    解决方案

    检查您的提交是否在其描述中包含 Change-Id:... 。每个提交应该有它们。



    如果不是,请使用 git rebase -i 来重命名提交消息并添加适当的Change-Ids(通常这是第一版审查提交的SHA1)。

    将来,您应该安装提交挂钩,它会自动添加所需的更改-Id。
    $ b

    执行 scp -p -P 29418 username @ your_gerrit_address:hooks / commit-msg .git / hooks / 在版本库目录
    中,或从
    http:// your_gerrit_address / tools / hooks / commit-msg 下载它们并复制到.git /钩子


    I set up a branch in the remote repository and made some commits on that branch. Now I want to merge the remote branch to the remote master.

    Basically follows are my operations:

    1. checkout branch
    2. checkout master
    3. merge branch and fix merging errors
    4. commit
    5. push origin HEAD:refs/for/master

    But get error messages on the 5th step:

    remote: Resolving deltas:   0% (0/12)
    
    remote: ERROR: missing Change-Id in commit message
    ...
    
    remote: Change-Id: I55862204ef71f69bc88c79fe2259f7cb8365699a
    
    To ssh://prc@test.gerrit.xxx.com:29418/hello_git
     ! [remote rejected] HEAD -> refs/for/master (missing Change-Id in commit message)
    

    解决方案

    Check if your commits have Change-Id: ... in their descriptions. Every commit should have them.

    If no, use git rebase -i to reword the commit messages and add proper Change-Ids (usually this is a SHA1 of the first version of the reviewed commit).

    For the future, you should install commit hook, which automatically adds the required Change-Id.

    Execute scp -p -P 29418 username@your_gerrit_address:hooks/commit-msg .git/hooks/ in the repository directory or download them from http://your_gerrit_address/tools/hooks/commit-msg and copy to .git/hooks

    这篇关于提交消息中的Change-Id丢失时Gerrit错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆