Feature: Regex defining Branch Protection, rather than previously pushed branches.
Created by: ghost
Our release process here, requires us to branch the release off of master, into a "release-v##.##" named branch. We already protect master, but it would be extremely valuable to protected based on branch name using some form of regex. So our master protection, would just be due to a "/^master$/ regex, rather than the actual branch.
It would also let you protect master prior to pushing.
I don't have the ruby skills to cover all of this, especially the UI to it. But the integration points I've found are
gitlabhq/app/models/project.rb#409
# Check if current branch name is marked as protected in the system def protected_branch? branch_name protected_branches_names.include?(branch_name) end
I don't think this would protect against new branches though.
This issue + comment I think would: https://github.com/gitlabhq/gitlabhq/issues/3775#issuecomment-18245600 by @mjdetullio seems like it might take care of protecting branches as someone is attempting to push it into gitlab via ssh. Although it was not written with using regex as the protection criteria (that wasn't that person's issue), I think it could be changed to allow this.
I think this would make gitlab valuable by allowing it to be extremely flexible with any kind of SCM work flow, like gitflow, "gitlab flow", ad-hoc.
Does this sound like something other people would be interested in? Would it be considered if I had a working branch?