Gerrit总是在提交补丁集之前进行基准调整,以避免合并提交 [英] Gerrit always rebase before submit patchset to avoid a merge commit

查看:322
本文介绍了Gerrit总是在提交补丁集之前进行基准调整,以避免合并提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现,在 Gerrit 网络界面中单击提交补丁集"时,它要么简单地向该分支添加一个提交,要么在之前提交另一个提交时创建合并提交.

I found that when clicking "Submit Patch Set" in the Gerrit web interface, it'll either simply add a commit to that branch, or create a merge commit if another commit was submitted just before.

创建2个提交的示例:实际提交和合并提交:

Example that creates 2 commit: The actual commit and a merge commit:

  1. 用户根据提交O提交补丁集A
  2. 用户根据提交O提交补丁集B
  3. 提交补丁集A
  4. 提交补丁集B->在O-> A和O-> B之间创建合并提交

有一个"Rebase Change"按钮,该按钮很棒,但是这意味着每个人都应该始终提交补丁集:

There is a "Rebase Change" button which is great but it means that to submit a patch set everyone should always do:

  1. 点击更改基础
  2. 点击提交更改集
  1. Click Rebase Change
  2. Click Submit Change Set

我看到合并提交很有用的唯一原因是保留提交的日期(但我确实理解为什么不重新设置就必须这样做).

The only reason I see a merge commit useful is to keep dates of the commits (but I do understand why it is required without a rebase).

是否没有自动变基或至少没有进行检查以避免生成不希望的合并提交?

Isn't there an automatic rebase or at least a check to avoid generating an undesired merge commit?

推荐答案

是.将您的项目的提交操作"更改为Cherry Pick.这与按下提交按钮时的重新设置大致相同.提交更改时,它将保留您要查找的干净历史记录,而无需合并提交.

Yes. Change the Submit Action for your project(s) to Cherry Pick. This will do roughly the same as rebasing when the submit button is pressed. It will keep the clean history you are looking for with no merge commits when submitting changes.

这篇关于Gerrit总是在提交补丁集之前进行基准调整,以避免合并提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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