git 如何在 Gerrit 中创建新的补丁集?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16118947/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 16:00:19  来源:igfitidea点击:

How to create a new Patchset in Gerrit?

gitgerritgit-commitamend

提问by Gangaraju

I am new to Gerrit and want to create a new Patch when new changes are submitted. I setup Gerrit with this guide https://review.typo3.org/Documentation/install-quick.html

我是 Gerrit 的新手,想在提交新更改时创建一个新补丁。我使用本指南设置 Gerrit https://review.typo3.org/Documentation/install-quick.html

Then I try to create a new patch with http://gerrit.googlecode.com/svn/documentation/2.0/user-changeid.htmland also added Change-Idline at bottom of the Commit-message.

然后我尝试使用http://gerrit.googlecode.com/svn/documentation/2.0/user-changeid.html创建一个新补丁,并Change-Id在 Commit-message 的底部添加了一行。

But I am getting new Change instead of new Patchset. Can anyone help me?

但是我得到的是新的 Change 而不是新的 Patchset。谁能帮我?

Thanks

谢谢

回答by Gangaraju

Step 1: Install commit-msg hooks for gerrit

第 1 步:为 gerrit 安装 commit-msg 钩子

scp -p -P 29418 localhost:hooks/commit-msg .git/hooks/

Step 2: Create normal commit and push (for Patchset1)

第 2 步:创建正常的提交和推送(对于 Patchset1)

for example:

例如:

git add Server.java
git commit -m "server added"
git push origin HEAD:refs/for/master

Step 3: After doing some changes to Server.java

第 3 步:对 Server.java 进行一些更改后

Finally to create new Patchset (Patchset 2)

最后创建新的补丁集(补丁集 2)

git add Server.java
git commit --amend
git push origin HEAD:refs/for/master

Repeat step 3 for further Patches

对更多补丁重复步骤 3

回答by StephenKing

Don't add the Change-Idon your own. Install the commit-msg hook as described here. This will automatically create the Change-Idfor you.

不要自行添加Change-Id。按照此处所述安装 commit-msg 挂钩。这将自动为您创建Change-Id

If you want to improve a patch by uploading a new patch-set, use git-commit --amendand keepthe Change-Idline as it is.

如果你想上传一个新的补丁集,可改善其补丁git-commit --amend保持变化-ID行,因为它是。

You can see a description of the workflow here: http://wiki.typo3.org/Contribution_Walkthrough_with_CommandLine

您可以在此处查看工作流程的说明:http: //wiki.typo3.org/Contribution_Walkthrough_with_CommandLine

回答by mrutyunjay

Even if you add Change id manually it should be last paragraph of your commit message.
And the syntax should be :

即使您手动添加更改 ID,它也应该是提交消息的最后一段。
语法应该是:

change ID : [change ID ]