Hello,
It is rare, but we've had cases where a user accidentally pushes to `refs/heads/refs/for/master` or `refs/refs/for/master`. In both cases, this prevents all users from pushing new changes until the offending branch is deleted.
To ssh://gerrit:29418/foo/bar ! [rejected] cfa36d7d5a61c6c45fa37227936c2687e2cdb26c -> refs/for/master (non-fast-forward) error: failed to push some refs to 'ssh://gerrit:29418/foo/bar' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and integrate the remote changes hint: (e.g. 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
This isn't hard to fix for an admin, but is extremely confusing and disruptive to users. Is there any way to configure Gerrit to prevent users from creating `refs/for/*` branches?
We have Push and Create Reference permissions configured for refs/for/*, since we want people to be able to push feature branches without review.
I can't imagine any valid use case where someone wants to actually create a branch named `refs/for/master`. Maybe it would make sense to just hard-code Gerrit to deny pushes to `refs/heads/refs/for/*` and `refs/refs/for/*`?
(Semi-related, is it possible to allow people to Push to all branches besides refs/for/master?)
Thanks,
Marquis