sam
sam

Reputation: 1290

Gerrit submit change after abandoning its parent

I have a situation where I have pushed changeA and changeB to Gerrit. changeA is the parent of changeB.

changeA was abandoned. Will changeB will automatically be merged if its approved? If yes, what would its parent be?

If changeB will not automatically be merged, what do I need to do to have it merge properly?

Upvotes: 5

Views: 10342

Answers (2)

Brent K.
Brent K.

Reputation: 1076

From the Gerrit UI, just abandon ChangeA, then rebase ChangeB and select the checkbox for "Change parent revision". This updates the parent of ChangeB to the current branch tip.

Upvotes: 9

uncletall
uncletall

Reputation: 6842

There is a few options and it depends if you want to include the changes of patchset-1.

  1. You only want the changes from patchset-2? Checkout master and cherry-pick patchset-2, commit -amend and push again
  2. You want to include changes from patchset-1 and 2? In this case you may want to combine the two patchsets, easiest is to do a git reset HEAD~2 and commit again, don't forget to copy the Change-ID of your last commit to be able to continue that review

Upvotes: 0

Related Questions