question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Required formatting for branch name not allowed

See original GitHub issue

Description

The GitHub desktop app currently helps automatically formats the branch name with some variation of kebab-case. However, this is proving a little bit too strict for my company’s workflow. We have some automatic actions that run when a name branch is suffixed with --preview. The desktop app automatically replaces multiple dashes with a single dash, so something like branch-name--preview becomes branch-name-preview.

I would very much appreciate it if the app allowed for a little bit more freedom with how users name their branches.

Version

GitHub Desktop version: 10.0.10

OS version: MacOS 10.13.1

Steps to Reproduce

  1. Branch -> New Branch
  2. Name a branch with–multiple–dashes—
  3. The branch name will be reformatted to only allow one dash between words.

Expected behavior: More flexible naming conventions are allowed

Actual behavior: Strict kebab-case is applied

Reproduces how often: Always

Logs

Additional Information

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
stevemosercommented, May 15, 2018

@ofek @joshaber I thought was running into the issue of not being able to create a ‘feature/feature-name’ type of branch and found this issue. However it looks like maybe I just ran into a UX bug. When I type ‘feature/’ the app shows a validation error instantly and I thought that no slashes were allowed. Maybe only show the validation error on submission so that users don’t think that branch names with forwards slashes in the middle of them are not allowed. Or maybe it is just me 😃

0reactions
davidrmusticommented, May 24, 2021

@ofek @joshaber I thought was running into the issue of not being able to create a ‘feature/feature-name’ type of branch and found this issue. However it looks like maybe I just ran into a UX bug. When I type ‘feature/’ the app shows a validation error instantly and I thought that no slashes were allowed. Maybe only show the validation error on submission so that users don’t think that branch names with forwards slashes in the middle of them are not allowed. Or maybe it is just me 😃

As suggested by @iAmWillShepherd, I opened a new enhancement issue for this “UX bug” you mentioned here as I also ran into this and was confused: Modify warning about forward slashes in branch name

Read more comments on GitHub >

github_iconTop Results From Across the Web

Which characters are illegal within a branch name?
Naming rules for refname: Git imposes the following rules on how references are named: They can include slash / for hierarchical (directory) grouping, ......
Read more >
Valid Branch Names (#38817) · Issues - GitLab.org
GitLab let's you create non valid Git branch names. ... think the problem is only with dashes as the first character but I...
Read more >
Legal Git branch names · wincent.com
Overview. A Git branch name can not: Have a path component that begins with . Have a double dot .. Have an ASCII...
Read more >
Git - git-check-ref-format Documentation - Git SCM
This enforces the presence of a category like heads/ , tags/ etc. but the actual names are not restricted. If the --allow-onelevel option...
Read more >
Git Branch Naming Rules and Conventions - YouTube
In Git we have a fair amount of freedom in how we name our branches. But there are some conventions and, most importantly,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found