[Development] gerrit : pointers to use it cleverly/efficiently?
Rolland Dudemaine
rolland at ghs.com
Fri Apr 1 08:22:42 CEST 2016
On 30/03/2016 18:04, Thiago Macieira wrote:
> On quarta-feira, 30 de março de 2016 09:41:12 PDT Rolland Dudemaine wrote:
>> git checkout -b temp origin/5.7
>> git cherry-pick first-commit-sha second-commit-sha (or just one of those)
>> git push gerrit HEAD:refs/for/5.7
>> git checkout 5.7
>> git branch -D temp
>>
>> But git-gpush as Thiago mentioned may be still far better...
> This is exactly what git gpush does, except that it does everything without
> changing your checkout, which means you won't trigger a full rebuild-the-
> world. It has a few more features beyond that, including the ability to pass
> reviewers in the command-line and handling of multiple patch groups in the
> same branch, for those who are crazy to develop like I am.
>
> Sometimes, the cherry-picking without checkout fails. So you may have to do
> the above anyway. If this happens often enough, like it does for me, I
> recommend having a separate clone or git new-workdir, so you aren't forced to
> rebuild the world.
>
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.
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.
--Rolland
More information about the Development
mailing list