cfg/.zsh/complete/_git-ps
Knut Ahlers 2cea257954
Add auto-completion for git-ps command
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2022-09-28 15:49:44 +02:00

14 lines
352 B
Text

#compdef git-ps
#description switches to specified branch and updates from remote
_git-ps() {
local options=(
'-d:detect base branch'
)
for branch in $(git branch 2>/dev/null | sed 's/^..//'); do
options+=("${branch}:$(git log -n1 --format='[%G?] %(describe:tags) - %ar - %s - %an' ${branch})")
done
_describe 'branches' options
}