Is it possible to add patch sets to a Gerrit review without ammending/squashing commits

ぐ巨炮叔叔 提交于 2019-12-05 05:19:22

git commit --amend works pretty well; that how we do it most of the time.

This has been discussed on the gerrit mailing list: http://groups.google.com/group/repo-discuss/browse_thread/thread/fc4246f02b77aa9a

Gerrit "patches" are meant as a replacement for the original change being reviewed, not a child commit. The 2nd and subsequent patches are not rewriting history, they are replacements for the present. As such an "amendment" is suitable because history has not been written yet.

Re-basing means you change the lineage of your original work. Amending also makes a new commit and thus the commit time stamp for legal purposes, but does not change the lineage.

If you were to have your CI build on an "integration" branch instead and accept periods of instability, you could submit a "fix" for review first and have a "Try build" of the change commit for sanity, and only do CI builds when those reviews are merged. This would mean never needing to change history, but you may get much more history as you iterate through various attempts at cleanliness in the design.

Gerrit/Git allows re-writes so that open source, which cares less about provenance, can keep a tidier history. Enterprises which care can use a more accurate history approach.

It might be worth noting that as of version 2.11 (released April 2015), Gerrit offers the possibility to edit changes using the web UI. This feature is described in-depth in the official documentation.

When viewing a diff, simply click the edit button:

Edit the file as you see fit, then save the file. You can edit multiple files and then hit Publish edit to create a new patch set.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!