[Development] Needing another advise using git

Frederik Gladhorn frederik.gladhorn at qt.io
Fri Oct 6 11:01:45 CEST 2017

On onsdag 4. oktober 2017 19.28.43 CEST Daniel Savi wrote:
> Thank you all for the helpful comments on my previous message.
> I think that I have now managed to amend my changes into one commit and
> may understand how to react on comments.
> While amending my commits I must somehow have pushed another commit
> again that is not from me at all. It is this one:
> https://codereview.qt-project.org/#/c/207639/
> I certainly did not intend to push this one. How should I proceed to
> delete this commit from my changes?

You should just abandon the commit that was accidentally pushed (to avoid 
confusion I just did). I think this happens to most of use at some point in 
time (I managed to push a huge series once, several people got confused, 
including me). Ideally don't rebase changes unless needed and just work on top 
of some branch. When rebasing is needed, do the rebase without further changes 
and comment on that in gerrit to let reviewers know. Then push further changes 
in a separate commit. This dance is only needed when changes that were merged 
conflict with your change.

The dependencies shown in gerrit do not matter on a practical level, they are 
only meant for people to be able to follow through series of changes, but in 
the end the only important thing is whether a cherry-pick of a comment will 
succeed or not.

In other words, now it shows your comment with a dependency that is bogus (the 
abandoned change) but that has no practical implications and should just be 
ignored by reviewers.

Since there seems to be a lot of confusion around this: gerrit only shows the 
state of the parent commit. When pushing two commits that depend on each other 
and the first one is merged, the second one will by necessity show that it's 
dependency will have been cherry-picked. Any cherry-pick changes the commit 
since it includes the date (and the parent commit potentially changes). This 
is fine. It's unfortunate that our gerrit version shows it in big and red, but 
don't be scared by that. The only thing that matters (you can verify this at 
home with your own git checkout) is that the cherry-pick succeeds.


> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development

More information about the Development mailing list