4 ms·
But you don't force push with Gerrit? Just update your change set, then push to refs/for/<branch_name> again.
by depressedpanda 6y ago
But you don't force push with Gerrit?
Just update your change set, then push to refs/for/<branch_name> again.
- 20after4 6y agoIt's effectively similar to a force-push.
- depressedpanda 6y agoI would say it's quite different, since you don't overwrite anything. Old patch sets are still available should you wish to roll back/reference either a particular commit, or a whole chain of commits.
- js2 6y agoIt's been a while since I used it, but I guess the more important point is that it's a rebase-based workflow. My memory was you had to force push your working branch to refs/for. Thank you for the correction. I've actually setup and run instances of it as two companies, but as I say, it's been a while.
- depressedpanda 6y agoYes, I very much agree: the rebase-based workflow is what makes Gerrit superior to all other systems I've tried (of which I find Github and Bitbucket particularly loathsome). I felt I needed to correct you because with Gerrit you reserve the concept of force pushing for exceptional cases, which I think is the correct mental model. Force pushing should not be done frivolously.
- kortilla 6y agoIt is a force push under the hood. You’re removing an old commit and creating a new one.
- lacksconfidence 6y agoIt's not a force push under the hood. Under the hood a new branch is created (first patch set is /refs/changes/nnnn/0, second is /refs/changes/nnnn/1, etc.). From the end user perspective the result is quite plausibly similar to force push.
- kortilla 6y agoThe branch model must have changed. I used to push directly to a branch that was the change number (not the revision number) and of course had to force because it was the same. So what happens when you push to changes/nnnn/12 when revision 11 hasn’t been created?
- lacksconfidence 6y agoAt least the way our installation works we don't push to changes/nnnn/12, rather changes are pushed to refs/for/{branch} (often refs/for/master). This endpoint isn't an actual branch. It triggers gerrit to look up the nnnn for the Change-Id in the commit message and create the appropriate branch for the next patch set.