git / gerrit best work flow ?

Norbert Thiebaud nthiebaud at gmail.com
Mon Nov 9 10:11:53 PST 2015


On Mon, Nov 9, 2015 at 11:00 AM, jan iversen
<jani at documentfoundation.org> wrote:
> Hi.
>
> I have a lode setup with dev/core and dev/work. I use work to work on my own
> patches.
>
> Sometimes I have to correct an older patch set, I do the following in core:
>
> git pull
> <cherry pick gerrit patch set>
> make changes
> ./logerrit ...
>

no need to git pull, and when you pull take the habit of doing git
pull -r not git pull
if your git config is set right, git pull shoudl do pit pull -r... but
if not you may end-up with a merge commit.. which is a no-no.

git fetch origin refs/changes/......
git checkout FETCH_HEAD
(note these 2 commands are provided to you in the gerrit ui under the
'download pull-down on the top right.. second choice)

modify build etc..

then
git add <suff changed>
git commit --amend
and
git push origin HEAD:refs/for/master  (assuming the patch was for the
master branch)

then git checkout master to return to master
if there is any left-over changes (and there should not have been or
that indicate you likely did not amend your original commit correctly)
you can do : git reset --hard

Norbert


More information about the LibreOffice mailing list