+1

Gerrit: Add possibility to push detached head

fourier 1 year ago updated 1 year ago 1

I'm trying to play around with Gerrit. One important missing thing I found is that in typical Gerrit workflow the developers checkout the Gerrit Change, do the changes, amend the commit and push it. For that developers work with detached heads, and pushing looks like this:

git push origin HEAD:refs/for/some-branch

Currently if the HEAD does not belong to any branch it is not possible to even click the Push As... button. If it would be possible to push the button and the appearing prompt would save a history (so I can enter refs/for/my-branch or refs/for/my-other-branch and could select any of them in some dropdown box), it would make the workflow with Gerrit quite functional.

After some evaluation with Gerrit, I can see this could be added to Push to Gerrit... dialog. Then the list of refs in the window should be build from local branches (or entered manually), i.e. if one have branches for example 'features/myfeature' and 'release-0.1', the popup window should provide options to select

refs/for/features/myfeature

refs/for/release-0.1

as well as the freetext input.

I haven't tested the "Draft" option, but there recent versions of gerrit requires the refs for draft/work in progress should look like

refs/for/branch%wip