如何摆脱gerrit中的错误依赖 [英] How to get rid of false dependencies in gerrit

查看:312
本文介绍了如何摆脱gerrit中的错误依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来,在使用gerrit时,默认情况下所有更改都取决于前一个。我不会为新的更改进行分支,我只需要关闭主分支,然后将提交的更改推送到远程原点/主设备。每次都创建一个依赖关系,即使这两个提交没有任何关系。



我遇到了几个问题,这让我觉得我不是



在我的git / gerrit工作流程中,每次提交时都会发生什么不同,以便不依赖于以前的提交?我也尝试创建一个新的分支:

 > git pull origin master 
> git checkout -b new_branch
> #变更
> git add -A
> git commit #with gerrit的提交钩子.git /钩子
> git push origin< sha1>:refs / for / master

依赖于以前提交的项目。

解决方案

这就是 Gerrit 通过依赖关系 - 在另一个提交之上的提交。如果两者都在审核中,则较新的依赖于较旧的。



如果您不希望它们彼此依赖,请不要创建提交彼此顶部。创建一个提交,然后为你的下一次提交创建一个基于master的新分支


$ b

(git checkout origin / master -b NEW_BRANCH_NAME)



当您将第二次提交进行审查时,它的父代已经发布,并且不会依赖于任何内容。


It appears that when using gerrit, by default all changes depend on the previous one. I do not branch for new changes, I simply work off the master branch and then push the commited changes to a remote origin/master. A dependency is created every time even if the two commits have nothing to do with each other.

I've run into a few issues which makes me think that I am not using git correctly in combination with gerrit.

What should happen differently in my git/gerrit workflow for every commit to not be dependent on the previous commit? I've also tried creating a new branch for the change:

> git pull origin master
> git checkout -b new_branch
> #make a change
> git add -A
> git commit #with gerrit's commit hook in .git/hooks
> git push origin <sha1>:refs/for/master

This works, but gerrit still reports a dependency on the previously commited item.

解决方案

This is what Gerrit means by dependencies - A commit which is on top of another commit. If both are in review, the newer one depends on the older one.

If you don't want them to depend on each other, don't create the commits on top of each other. Create one commit, then make a new branch based on master for your next commit

(git checkout origin/master -b NEW_BRANCH_NAME).

When you push the second commit up for review, it's parent will already be published and it won't depend on anything.

这篇关于如何摆脱gerrit中的错误依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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