oh-my-bash icon indicating copy to clipboard operation
oh-my-bash copied to clipboard

base.theme.sh git branch names fix

Open zealotous opened this issue 4 years ago • 4 comments

base theme replaces underscores in a branch name. hello_world -> hello-world

It's inconvenient when a end user copy-pastes the branch name from PS1 and impossible to force everybody to use - in branch names.

zealotous avatar Nov 03 '20 16:11 zealotous

@nntoan Could you take a look? Please let me know if need more description.

zealotous avatar Nov 03 '20 16:11 zealotous

@chaifeng , @surendrand, @jverce Yo Guys, can you take a look at the PR

zealotous avatar Nov 13 '20 10:11 zealotous

I'm seeing in other themes that they don't even do a cleanup of the branch name (other than the obvious removal of refs/heads/). For example:

We might get away with removing the cleanup altogether since git already prevents certain characters from being used in branch names:

jay@jay-desktop > ~/dev/dummy_repo > master$ git checkout -b 'foo:bar'
fatal: 'foo:bar' is not a valid branch name.

✘ jay@jay-desktop > ~/dev/dummy_repo > master$ git checkout -b 'foo;bar'
Switched to a new branch 'foo;bar'

jay@jay-desktop > ~/dev/dummy_repo > foo;bar$

What do you think?

jverce avatar Nov 13 '20 14:11 jverce

Ah, #200 was actually a duplicate of this PR. I have already merged #200. Sorry for the missing credit.

I'm seeing in other themes that they don't even do a cleanup of the branch name (other than the obvious removal of refs/heads/).

Maybe we can think of completely removing these escapes.

akinomyoga avatar Dec 24 '21 13:12 akinomyoga

As I have written in the previous reply, I failed to pick up your contribution in the repository. Nevertheless, let me thank you again for opening the PR! Let me close the PR now.

For your reference, recently we have merged another commit to allow a wider range of git branch names in PR #420.

Thank you again.

akinomyoga avatar Apr 05 '23 02:04 akinomyoga