Add auto-completion for git-ps
command
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
82f778ccf4
commit
2cea257954
1 changed files with 14 additions and 0 deletions
14
.zsh/complete/_git-ps
Normal file
14
.zsh/complete/_git-ps
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#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
|
||||||
|
}
|
Loading…
Reference in a new issue