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

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

问题描述

我对 Gerrit 进行了四次更改,每一次都取决于前一次(当然,第一次除外).我已经放弃了第二和第三,并审查了第一和第四.由于 first 不依赖于任何东西,Gerrit 设法自动合并它.现在,第四个(取决于放弃的第三个)是一个真正的问题.

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 声明 Submitted, Merge Pending 与:

Gerrit states Submitted, Merge Pending with:

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

并给我两个放弃的更改的更改 ID.我怎样才能摆脱这种混乱?

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

根据我已经通过谷歌搜索和 SO-ing 学到的知识(尤其是 this这个——没有多大帮助),整个问题出现了,因为我没有使用分支,只直接在 上工作大师.

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.

好的,我保证下次会更好,但是如何解决当前的问题?我尝试应用许多解决方案,在 Internet 或此处找到,在 SO 上,但没有一个有帮助.每个 git pullgit push 都声称我的本地和远程都是最新的,但我认为没有办法摆脱依赖更改.

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.

推荐答案

你需要从commit 4的祖先中删除与被放弃的更改相对应的两个不需要的提交,即期望的状态是git log 仅列出提交 4 和 1.完成后,推送新的补丁集应删除所述的依赖关系.摆脱提交 2 和 3 可以通过多种方式完成,包括

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

  • 执行交互式 rebase(git rebase -i HEAD~4 并删除您不想要的两个提交的行),或
  • 根据上游分支的尖端和樱桃采摘提交 4 启动一个新分支.
  • 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天全站免登陆