Gerrit rebase review branch for the latest changes from the ascending branch

Is it possible to reinstall the topic thread with some changes awaiting consideration upstream? I want to keep all comments for the review, etc., but also make the latest changes to the upstream.

I was thinking about the following workflow (not sure if it works):

  • redirect the local thread to the latest changes from the upstream;
  • Forcibly push new commits in the local topic branch (without commits placed in gerrit for verification) to gerrit refs / heads / thetopicbranch to replace the commit in the gerrit branch with new upstream changes;
  • drag the local thread of the topic header to gerrit to view it, i.e. HEAD: refs / for / thetopicbranch - this will lead to changes that need to be checked, and gerrit (hopefully) match, which are done with their Change-Id already pressed.

The same thing, but in git commands (everything is done on the local thread):

  • git rebase upstream
  • git push gerrit: project `git merge-base upstream localtopicbranch`: refs / heads / thetopicbranch -f
  • git push gerrit: project HEAD: refs / for / thetopicbranch

Will this circuit work?

+4
source share
1 answer

I’m sure that it’s quite simple to put some changes in the topic branch on top of other upstream changes that are expected in Gerrit. The workflow that I usually use:

  • Download the required changes as a parent. Usually you do not want to create a new patch set for these changes, so I use the "git checkout" command, which you can copy from Gerrit. Using other commands (pull and cherry-pick) you will create a new commit if there has been another development since loading the previous version.
  • Cherry - select the change you want to be at the top of the changes (up) that you just pulled down. Copy-paste git cherry-pick command from gerrit
  • Download to gerrit via git push <server> HEAD:refs/for/<topicBranch>
+1
source

All Articles