Support renaming the `master` branch without disruption
Problem to solve
Provide an easy way for a maintainer of an existing repository who wants to move away from the master
name for the default branch (for the same reasons a user would choose a different default branch name for a new repository) to rename the branch without causing massive disruption.
Intended users
Presumably the same as the feature for choosing the initial branch name.
User experience goal
A repository maintainer can rename the master
branch via UI or some other straightforward documented method.
Proposal
Currently, if I manually create a branch with the desired new name, I can set it as the default branch, but AIUI that only affects newly created merge requests and maybe a few other things. We probably want to introduce a separate mechanism for a branch rename.
Things the new feature would need to do:
- Existing local clones that reference the old branch name should still be able to fetch it and (if possible) push to it, possibly with a warning to the user. There's an ongoing discussion of features that might be added to the standard git client and server to facilitate branch renames. GitLab may be able to use some of those or may need its own implementation depending on technical constraints (I haven't researched how GitLab is currently implemented).
- Existing merge requests targeting the old branch name should be updated to target the new branch name: should be straightforward.
- Forks of the repository hosted on GitLab: I'm not familiar with what might need to be done.
- Probably more. Every GitLab feature may need to be reviewed.
Further details
Nothing to say here yet
Permissions and Security
It looks to me that project maintainer would be the most appropriate permission to require for this action.
Documentation
TBD
Availability & Testing
TBD
What does success look like, and how can we measure that?
TBD
What is the type of buyer?
Presumably the same as the feature for choosing the initial branch name.
Is this a cross-stage feature?
TBD