Create the B commit in a new branch.
While being on this branch, use git review
and it will only push the content of this branch to Gerrit.
This way, Gerrit won't consider that your commit B needs your commit A and if you want, you can merge your commit B to the working branch before commit A
If your history is like this:
...-old(merged)-A(waiting for review)
what you want to do is:
...-old(merged)-A(waiting for review) <-master branch
B(new commit) <-new branch
Then, if you're on branch B, and use git review
, it won't push anything else than commit B
If you're in this situation:
...-old(merged)-A(waiting for review)-B
, what you want to do to achieve the configuration we want is:
git log (Note the SHA1 of your B commit)
git reset HEAD^^^ (you go back in detched state three commits before, before the two you don't want to send)
git checkout -b Breview (you create a new branch there)
git cherry-pick +the SHA1 you noted (you copy your B commit on your new branch)
git checkout master (you return on your branch with the two commit)
git reset HEAD^--hard (you delete the B commit from this branch where you don't need it)
Now, you achieved the wanted configuration and to push your B commit, you just need to do:
git checkout Breview
git review
and it will only submit your B commit
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…