在Gerrit中缺少依赖 [英] Missing dependency in Gerrit

查看:975
本文介绍了在Gerrit中缺少依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Gerrit中有四个变化,分别取决于前一个(当然除了第一个)。我已经放弃了第二和第三,并回顾了第一和第四。由于首先不依赖任何东西,Gerrit设法自动合并。现在,第四个(取决于被遗弃的第三个)是一个真正的问题。



Gerrit状态提交,合并待处理

 由于缺少依赖关系,更改无法合并。 
还必须提交以下更改:

变化。我如何摆脱这种混乱?



从我已经通过谷歌搜索和SO-ing学到的东西(特别是这一个 - 没有什么帮助),整个问题出现了,因为我没有使用分支,只能直接在 master 上工作。



我下一次承诺会更好,但如何解决当前的问题?我试图在SO上应用许多在互联网上或这里找到的解决方案,但是它们都没有帮助。每个 git pull git push 声称,我的本地和远程都是最新的,但我看到没有办法摆脱依赖的变化。

解决方案

您需要删除与祖先遗弃的更改相对应的两个不需要的提交的提交4,即所需的状态是 git log 只列出提交4和1.当这样做时,推一个新的补丁集应该删除所述的依赖关系。删除提交2和3可以在许多方面进行,包括




  • 进行交互式rebase( git rebase -i HEAD〜4 并删除不需要的两个提交的行),或

  • 根据上游的提示启动新的分支分支和樱桃采摘提交4。


I had four changes in Gerrit, each depending on previous one (except first, of course). I've abandoned second and third and reviewed first and fourth. Since first wasn't depending on anything, Gerrit managed to auto-merge it. Now, the fourth (depending on abandoned third) is a real problem.

Gerrit states Submitted, Merge Pending with:

Change could not be merged because of a missing dependency.
The following changes must also be submitted:

and giving me change-Id of both abandoned changes. How can I get rid of this chaos?

From what I've already learnt by googling and SO-ing (especially this and this one -- doesn't help much), the entire problem arose, because I haven't been using branches, only working directly on master.

Fine, I'll promise to be better next time, but how to fix current problem? I've tried to apply many solutions, found in the Internet or here, on SO, but none of them helps. Each git pull and git push claims, that both my local and remote are up-to-date, but I see no way to get rid of dependent change.

解决方案

You need to remove the two unwanted commits corresponding to the abandoned changes from the ancestry of commit 4, i.e. the desired state is for git log to only list commits 4 and 1. When that's done, pushing a new patch set should remove the stated dependency. Getting rid of commits 2 and 3 can be done in many ways, including

  • doing an interactive rebase (git rebase -i HEAD~4 and deleting the lines for the two commits you don't want), or
  • starting a new branch based on the tip of the upstream branch and cherry-picking commit 4.

这篇关于在Gerrit中缺少依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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