Vscode-pull-request-github: Be able to customize the branch name when starting work on an issue

Created on 8 May 2020  路  11Comments  路  Source: microsoft/vscode-pull-request-github

Currently, when you start working on an issue a branch is created with this format <userName>/issue<issueCode>. It would be nice to have if you could customize the branch name 馃槃

feature-request issues on-testplan

Most helpful comment

I like to use a slug of the issue name as the branch name, which I find way more descriptive than just using the issue number, what are the variables currently available? (Didn't see it in the settings entry in "Feature contributions" neither in the wiki)

All 11 comments

I second that, if I insert a static string like staging, the selection will go to default creating unwanted local branches, instead of using the given setting

Does using the setting githubIssues.workingIssueBranch solve this for you? This allows you to customize the branch name, the default is "githubIssues.workingIssueBranch": "${user}/issue${issueNumber}"

@misolori no not really - as I wrote setting it to something static, will lead to the effect that the default of "${user}/issue${issueNumber}" is used, which kind of makes it impossible to do something off the standard here

Ah, I see now. We could make it so that whenever githubIssues.workingIssueBranch is set to blank that it will prompt you for the branch name.

Yeah that would be an option, although having a fixed string in the config, which is taken into account would be the better solution IMO. Anyway empty = ask should solve my problem for now

It should be dynamic 馃槃 I think the simplest option is when the user starts working on an issue, the plugin asks what is the branch name. So each user could put the name as he prefers ...

It would also nice to have if the plugin asked you from which branch you create the new one.
By default the current! 馃槃

I like to use a slug of the issue name as the branch name, which I find way more descriptive than just using the issue number, what are the variables currently available? (Didn't see it in the settings entry in "Feature contributions" neither in the wiki)

I also want to +1 @ewen-lbh's comment.
If you could add more placeholders to use for the branch name it would be great!
I like naming my branches as <issue-number>-<issue-name>, and if I could set the setting to do it for me I wouldn't need the "always prompt when setting is empty" feature.

There is already a setting for showing a prompt when you start working on an issue: "githubIssues.useBranchForIssues": "prompt".

For <issue-name>, what would you expect to be there? The title of the issue with the spaces removed?

Pretty much. In Bitbucket you have the option to open a branch from a Jira issue. It converts whitespace and some other characters to hyphens.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulirish picture paulirish  路  3Comments

Jonnokc picture Jonnokc  路  3Comments

kieferrm picture kieferrm  路  4Comments

alexdima picture alexdima  路  3Comments

Tyriar picture Tyriar  路  3Comments