Skip to content
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

feat(git-aliases): add checkout with username (fixes #1712) #1732

Merged
merged 2 commits into from
Dec 13, 2020

Conversation

georgettica
Copy link
Contributor

this can be useful for creating a branch with a common prefix

fixes #1712

this can be useful for creating a branch with a common prefix
Copy link
Member

@NoahGorny NoahGorny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one @georgettica 😄
I left you a small comment, you can take look

@@ -65,6 +65,7 @@ alias gco='git checkout'
alias gcom='git checkout master'
alias gcb='git checkout -b'
alias gcob='git checkout -b'
alias gcobu="git checkout -b ${USER}/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use single quote instead of double quotes to match the rest of the file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to, but ${USER} won't expand if it's single quotes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, @georgettica how have you tested this?

in my local:

$ alias test='echo ${USER}/'
$ test

davidfa/

$ alias test

alias test='echo ${USER}/'

$ export USER=boo
$ test

boo/

This is in bash 5.0.7 on MacOS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it's me being silly. thanks so much @davidpfarrell .. seems it works and I was shooting from the hip. fixing now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, will create a subsequent req to fix all the double quotes to single quotes in the file

@NoahGorny
Copy link
Member

@georgettica great job! I am looking forward for your fix PR on this file- if you could also reorder the aliases and reorganize them it would be amazing!

@NoahGorny NoahGorny merged commit 4dfd8bc into Bash-it:master Dec 13, 2020
@georgettica
Copy link
Contributor Author

Yeah, I would do that even if you wouldn't ask.
Yw!

@georgettica georgettica deleted the patch-1 branch December 15, 2020 20:47
phreakocious pushed a commit to phreakocious/bash-it that referenced this pull request Dec 17, 2020
…ash-it#1732)

* feat(git-aliases): add checkout with username

this can be useful for creating a branch with a common prefix

* fix(git-alais): change quotes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create branch with prefix
3 participants