Good day.
Can you tell me please is it possible to install some addon that will convert spaces in branch name to underscore.
For example:
“PC-68 Filters and sorting styles” => “pc-68_filters_and_sorting_styles”
The main reason is — i do not want write each branch name manually. I looking way have some feature similar to Stash (it convert all Task name to Branch name automatically)
Thanks for any information
You could write a script to do this for you via the API, but it’s probably too niche to be a feature in the product itself. Sorry!
I’m not sure what the rationale is for being “too niche.” I have a hard time imagining anybody that would prefer to write a branch name in snake_case (and if they do, more power to them).
From the perspective of the GitLab UI, when branch creation is done there, it would seem to be rather reasonable to want spaces converted to underscores; it wouldn’t be a breaking change in anyway that I can see.
Other possibilities would be:
- for the UI to offer a safe name (eg, replacing spaces with underscores) and letting the user decide to use it or not
- to create a new variable within GitLab, say
%{safe_title}
that automatically converts the user-entered title to an acceptable name; then the project owner controls the branch naming behavior.
Perhaps in 2017, use of the UI was a minority of users; but in these last 5 years, that’s changed, and now I’m not sure that I know anybody who doesn’t interact with the UI for at least some tasks.
I believe people usually create branches automatically from their task management service (e.g. Jira) where this conversion takes place, or locally via IDEs that do the same.
However, if you want to create a feature proposal for GitLab - feel free to do so. A template can be found on FAQ - GitLab Forum