legacy-dotfiles/zsh/functions/prompt_git_info
2011-03-08 20:38:49 +01:00

23 lines
454 B
Bash
Executable file

# -*- mode: shell-script -*-
if [ -n "$__CURRENT_GIT_BRANCH" ]; then
local s="("
s+="$__CURRENT_GIT_BRANCH"
case "$__CURRENT_GIT_BRANCH_STATUS" in
ahead)
s+="^"
;;
diverged)
s+="-/="
;;
behind)
s+="v"
;;
esac
if [ -n "$__CURRENT_GIT_BRANCH_IS_DIRTY" ]; then
s+="*"
fi
s+=")"
printf " %s%s" "%{${fg[yellow]}%}" $s
fi