[Development] gerrit : pointers to use it cleverly/efficiently?

Welbourne Edward edward.welbourne at theqtcompany.com
Fri Apr 1 09:06:56 CEST 2016


Rolland Dudemaine said:
> Actually, git-gpush will update the whole history of changes that may
> be on your checkout, not only the single one you're pushing. Just been
> bitten by that this morning again, and that invalidates all your
> reviews on gerrit.

Well, any way of pushing is subject to that, yes.
The new commit can't arrive without all of its ancestors, that's a
feature of the git object model; and each of those ancestors has a
Commit-Id, so necessarily triggers an update to its review.

Not that this doesn't irritate me every time I trip over it ...

> Unless there is a magic I'm not aware of, the
> temporary-branch-plus-cherry-pick is the only way to push a single
> commit among a list of many.

That's probably inescapable, yes.

However, if there's a way to ask gerrit "here's a Commit-Id, please give
me the sha1 of its review's current patch set", then a script could
automate the

$ git checkout -b tmp $currentPSsha1^
$ git cherry-pick $newcommit
$ git push gerrit HEAD:refs/for/$branch

process.  I haven't played with gpush, so don't know if it knows how to
do that,

	Eddy.



More information about the Development mailing list