daniel.kahlenberg
daniel.kahlenberg

Reputation: 307

How to make a changeset pushed for code review dependent on newer changeset pushed for different code review afterwards

I wonder if it is possible to make an already pushed gerrit code review dependent on a pushed later different one, is there something like a Depends-On: <ChangeId> commit message footer?

If not, how would it be possible with git itself to rebase CR1 on CR2 without too much hassle?

Upvotes: 1

Views: 369

Answers (1)

msufa
msufa

Reputation: 443

Dependencies in Gerrit are normal parent-child git relationships. You can create a dependency by rebasing one code review patch set onto another one, like this (you can find the correct references from the patch set download menu):

git fetch ssh://your_repo/your_project refs/changes/n/changenum1/patchset:CR1
git fetch ssh://your_repo/your_project refs/changes/n/changenum2/patchset:CR2
git checkout CR1
git rebase CR2

Now you can publish your rebased CR1 as usual. You should see a dependency to CR2 for the updated patch set.

Upvotes: 2

Related Questions