Gerrit工作流程-将单个提交推送到主题分支 [英] Gerrit workflow - push single commit to topic branch

查看:251
本文介绍了Gerrit工作流程-将单个提交推送到主题分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在不影响同一主题分支中的其他提交的情况下将单个提交推送到Gerrit。不幸的是,我没有Gerrit的测试实例可以进行试验。

I want to push a single commit to Gerrit without affecting other commits in the same topic branch. Unfortunately I don't have a test instance of Gerrit to experiment with.

场景:
我已经向该项目(正在审核中),其他开发人员已对其进行了更新。现在,我希望在更新的基础上进行更改。

Scenario: I have contributed a topic branch to the project, which is in review, and other developers have updated parts of it. Now I wish to make changes on top of their updates.

为此,我在希望编辑的提交中由其他开发人员拉出更改,进行交互式变基在本地进行我自己的更改,然后推送到Gerrit,确保Change-Id仍然相同。这会将文件的新版本添加到补丁集中供审核。

To do this I pull the changes by the other developer in the commit I wish to edit, do an interactive rebase locally to make my own changes, then push to Gerrit, making sure the Change-Id is still the same. This adds a new version of the file to the patchset for review.

问题:
当我尝试推送单个提交时对于Gerrit,主题分支中的其他提交也被推送,覆盖了其他开发人员的更改。

Problem: When I tried to push a single commit to Gerrit, the other commits in the topic-branch were also pushed, overwriting changes by other developers.

这里是我使用的语法:

git push gerrit 3089c9f56542461dce738a9aa17bb743ed36e038:refs/publish/master/my-topic-branch

我认为由于Gerrit创建的依赖关系,主题分支中的其他提交也被推送了。

I presume that the other commits in the topic-branch were also pushed because of dependencies created by Gerrit.

代替工作方法,而忽略主题分支标题?:

Would this approach work instead, leaving out the topic branch title?:

git push gerrit 3089c9f56542461dce738a9aa17bb743ed36e038:refs/publish/master

我以前成功地尝试过这种方法,并推向特定的变更集:

I tried this approach successfully previously, pushing to the specific changeset:

git push gerrit a95cc0dcd7a8fd3e70b1243aa466a96de08ae731:refs/changes/12345

但是,在再次尝试此操作时,我现在遇到了打开错误:

However, in trying this again I am now getting an unpack error:

error: unpack failed: error Missing tree 9172313b907b160d15e260d5f7d51689f467b858

相关问题:
当我从Gerrit中提取其他开发人员的更改时,如何确保已提取在主题分支中贡献的所有文件?如果我在主题分支中选择Gerrit的最高更改,并使用Web ui中声明的pull命令,则似乎该主题分支中的某些文件在本地更新,但不是全部更新。我是否需要遍历主题分支中的每个提交并发出相关的pull命令?

Related question: When I pull the other developers' changes from Gerrit, how can I make sure that I have pulled all the files contributed in the topic-branch? If I select the topmost change in Gerrit in the topic-branch, and use the pull command stated in the web ui, it seems that some of the files in the topic-branch are updated locally, but not all. Do I need to go through every single commit in the topic-branch and issue the relevant pull command?

推荐答案

我没有知道手的命令,但是会像这样:

I don't know the commands of hand but it would be something like this:


  1. 创建主题分支的新分支

  2. 将要添加到主题分支的提交合并到这个新分支中

  3. 将新创建的合并推送到gerrit

这篇关于Gerrit工作流程-将单个提交推送到主题分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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