New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] git extension - add branch name validation #50241

Closed
raix opened this Issue May 21, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@raix
Contributor

raix commented May 21, 2018

Description:

  • Add validation to the git create branch, ensuring that project branch conventions are kept.
  • Make the whitespace char - configurable (we default space etc. to underscore - meaning we cannot just past in issue title and be done)

Example implementation:
vscode-create_branch_validation

I can create an initial pr. with the implementation for further discussion, if this is something the vscode team would consider.

eg. if the change should enable extensions to lint/validate the branch name or be a configuration etc.

Kind regards Morten

@vscodebot

This comment has been minimized.

Show comment
Hide comment
@vscodebot

vscodebot bot May 21, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

vscodebot bot commented May 21, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added the git label May 21, 2018

@joaomoreno joaomoreno added this to the Backlog milestone May 29, 2018

@joaomoreno

This comment has been minimized.

Show comment
Hide comment
@joaomoreno

joaomoreno May 29, 2018

Member

Sure, submit ahead.

Member

joaomoreno commented May 29, 2018

Sure, submit ahead.

@TomasHubelbauer

This comment has been minimized.

Show comment
Hide comment
@TomasHubelbauer

TomasHubelbauer May 29, 2018

Contributor

Is this really something that should be in VS Code? And not say a Git server hook?

Contributor

TomasHubelbauer commented May 29, 2018

Is this really something that should be in VS Code? And not say a Git server hook?

raix added a commit to raix/vscode that referenced this issue May 29, 2018

Add branch name validation and whitespace config
* Adds `git.createBranchNameConvention.regexp`
* Adds `git.createBranchWhitespaceChar`

Fixes Microsoft#50241
@raix

This comment has been minimized.

Show comment
Hide comment
@raix

raix May 29, 2018

Contributor

@joaomoreno I've added the pr.

@TomasHubelbauer ihmo being able to configure the character used for replacing whitespaces etc. in the branch name cannot be fixed in a hook.
The validation of the branch name it self is a better user experience than a git hook

Question is if this is the solution
or
if making an api available for extensions is a better solution eg. it could interact with github/vsts/jira to match ticket number and copy the title etc. in for you.

Contributor

raix commented May 29, 2018

@joaomoreno I've added the pr.

@TomasHubelbauer ihmo being able to configure the character used for replacing whitespaces etc. in the branch name cannot be fixed in a hook.
The validation of the branch name it self is a better user experience than a git hook

Question is if this is the solution
or
if making an api available for extensions is a better solution eg. it could interact with github/vsts/jira to match ticket number and copy the title etc. in for you.

@TomasHubelbauer

This comment has been minimized.

Show comment
Hide comment
@TomasHubelbauer

TomasHubelbauer May 29, 2018

Contributor

Hmm having an API for this would be actually quite interesting, because it would enable your scenario so that VS Code could work the best for you but also allow teams to publish extensions of their own which would check the branch name policies or perhaps even do clever things like suggest prepending current ticket code to the branch name automatically if forgotten etc.

Contributor

TomasHubelbauer commented May 29, 2018

Hmm having an API for this would be actually quite interesting, because it would enable your scenario so that VS Code could work the best for you but also allow teams to publish extensions of their own which would check the branch name policies or perhaps even do clever things like suggest prepending current ticket code to the branch name automatically if forgotten etc.

@raix

This comment has been minimized.

Show comment
Hide comment
@raix

raix Jun 12, 2018

Contributor

@TomasHubelbauer yes would be interesting - I'm currently digging into the vs code source. For now I've attached a gif on the pull request for both solutions.

Contributor

raix commented Jun 12, 2018

@TomasHubelbauer yes would be interesting - I'm currently digging into the vs code source. For now I've attached a gif on the pull request for both solutions.

@joaomoreno joaomoreno modified the milestones: Backlog, September 2018 Sep 13, 2018

@alexr00 alexr00 self-assigned this Sep 25, 2018

@alexr00 alexr00 removed their assignment Sep 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment