OpherV / gitflow4idea

Git Flow Integration plugin for IntelliJ
Apache License 2.0
504 stars 138 forks source link

Git-Flow fails on branch names with spaces #311

Open DarrenBishop opened 3 years ago

DarrenBishop commented 3 years ago

Would be awesome if there can be some simple/configurable sanitisation of the branch name used for the feature/hotfix/bugfix such that spaces are replaced with underscores and punctuation removed or replaced with underscores also.

I use JIRA integration and for any other issue tracker that uses PRJ-1234 style issue-ids, it would be great if an issue with id PRJ-1234 and summary Some JIRA managed issue with spaces in the summary could be transformed into

\<branch-type>/PRJ-1234-Some_JIRA_managed_issue_with_spaces_in_the_summary

The UI offers many options; it would be even better if there was an option (checkbox) to 'guess' the branch-type e.g. a bug in JIRA maps to a bugfix branch in git-flow.

I narrowed down a possible location for this change to here: https://github.com/OpherV/gitflow4idea/blob/8d35064a9aba2d9ba5cb6b2846bd5a97cccc5ee7/src/main/java/gitflow/ui/GitflowOpenTaskPanel.java#L119

ps. I am not experienced in Intellij UI Plugin development so hesitate to raise a PR for this - specifically, I am not familiar enough with the toolchain to test the changes, which is important, right?

OpherV commented 3 years ago

Thanks for the suggestion. "to 'guess' the branch-type e.g. a bug in JIRA maps to a bugfix branch in git-flow." How would you logically implement this?