Allow forced push to protected branch for particular user or add lock branch api
Created by: VicNumber21
After this change https://github.com/gitlabhq/gitlabhq/pull/6190 it is not possible to perform forced push to protected branch. I do understand the reason why it was done and I'm glad to have such feature. But in some circumstances forced push to protected branch is required still. A good example is mirroring p4 branch (p4 is main repository) to GitLab project to enable working via git. Since p4 is master repo and GitLab is a mirror, p4 history has bigger priority than GitLab one. So if conflict detected, sync user must rewrite history in GitLab and create MR with 'merged' changes to rebase them manually on top of commit synced from p4. Without protection it is hard to guarantee that acceptance of another merge request (or direct push) does not happen while sync process is in progress.
So I'd like to ask you: EITHER: to add some setting to allow forced push to protected branch for some particular user OR: to add permission group (e.g. TOOL) and to allow forced push to protected branch if user is TOOL in particular project OR: to add api like POST /projects/:projectId/repository/branches/:branchId/lock and POST /projects/:projectId/repository/branches/:branchId/unlock and to deny pushing to locked branch for all users except one who locked it. Also admin / owner (master?) should be able to unlock branch via UI
Hope on your understanding.