1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

aliases: Fix gfrb/gfrbi with slash-delimited branches

Multi-part branch names would be incorrectly split on the last slash and
not the first, causing these aliases to do the wrong thing. These need
the remote name which is the first element. Everything after the first
slash is the branch name, not the last slash.

Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
Joe Groocock 2022-10-24 15:24:19 +00:00
parent cfbe6d6f0f
commit 9331a74266
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86

View File

@ -139,8 +139,8 @@ alias grbc="grb --continue"
alias grbsk="grb --skip" alias grbsk="grb --skip"
alias grbsh="grb --show-current" alias grbsh="grb --show-current"
alias grbom="git rebase \"origin/\$(git defbranch)\"" alias grbom="git rebase \"origin/\$(git defbranch)\""
gfrb() { remote="${1%/*}"; git fetch "$remote" && git rebase "$@"; } gfrb() { remote="${1%%/*}"; git fetch "$remote" && git rebase "$@"; }
gfrbi() { remote="${1%/*}"; git fetch "$remote" && git rebase -i "$@"; } gfrbi() { remote="${1%%/*}"; git fetch "$remote" && git rebase -i "$@"; }
alias gam="git am" alias gam="git am"
alias gama="git am --abort" alias gama="git am --abort"