update aliases to default to current branch, fixes #1601

This commit is contained in:
ncanceill 2014-05-21 13:12:49 +02:00
commit be8e85b71c

View file

@ -166,14 +166,25 @@ compdef git-svn-dcommit-push=git
alias gsr='git svn rebase' alias gsr='git svn rebase'
alias gsd='git svn dcommit' alias gsd='git svn dcommit'
# Current branch # Current branch
alias ggpull='git pull origin $(current_branch)' ggl() {
compdef ggpull=git [[ "$#" != 1 ]] && b="$(current_branch)"
alias ggpur='git pull --rebase origin $(current_branch)' git pull origin "${b:=$1}"
compdef ggpur=git }
alias ggpush='git push origin $(current_branch)' compdef _git ggl=git-checkout
compdef ggpush=git ggu() {
alias ggpnp='git pull origin $(current_branch) &&git push origin $(current_branch)' [[ "$#" != 1 ]] && b="$(current_branch)"
compdef ggpnp=git git pull --rebase origin "${b:=$1}"
}
compdef _git ggu=git-checkout
ggp() {
[[ "$#" != 1 ]] && b="$(current_branch)"
git push origin "${b:=$1}"
}
compdef _git ggp=git-checkout
ggpnp() {
ggl "$1" && ggp "$1"
}
compdef _git ggpnp=git-checkout
# Work In Progress (wip) # Work In Progress (wip)
# These features allow to pause a branch development and switch to another one # These features allow to pause a branch development and switch to another one
# When you want to go back to work, just unwip it # When you want to go back to work, just unwip it