gitgerrit

Create a new patch set in Gerrit before reviewing patch set 1?


I am new to Gerrit, and I want to know about patch sets. Suppose I have created a review in Gerrit with patch set 1, and the review is still in progress. I know that some of the code needs to be updated, so I am thinking that I can push the new changes to the same review commit with another patch set (patch set 2) by using the commit --amend command. Is it possible to do this in Gerrit without reviewing the first changes?


Solution

  • Yes, that's exactly what will happen if you amend it. Further, if anyone has already reviewed the original patch set, but it is still not merged, Gerrit marks the original reviews as outdated, and ignores them. The change will need to be reviewed in its new entirety after you push the amended version. But any reviewer who saw an earlier version can diff patchset 1 to 2, and just see your latest edits.

    This is the normal workflow during a review. You push something as patch set 1. You get some feedback, so you amend your commit and upload it again (same push command as the first time). As long as you keep the "Change-Id:" line untouched, Gerrit will recognize it is a second patch set on the same commit.

    I also sometimes push changes to Gerrit well before they are ready. I just mark them "work-in-progress" in Gerrit. That gives me a remote backup. Then when it's ready I might have patch set 5 or 6 be the first I send for review.