legacy-dotfiles/.zsh/functions/prompt_git_info

24 lines
460 B
Text
Raw Normal View History

2010-12-05 12:50:00 +01:00
# -*- mode: shell-script -*-
if [ -n "$__CURRENT_GIT_BRANCH" ]; then
local s="("
s+="$__CURRENT_GIT_BRANCH"
case "$__CURRENT_GIT_BRANCH_STATUS" in
ahead)
s+="↑"
2010-12-05 12:50:00 +01:00
;;
diverged)
s+="↕"
2010-12-05 12:50:00 +01:00
;;
behind)
s+="↓"
2010-12-05 12:50:00 +01:00
;;
esac
if [ -n "$__CURRENT_GIT_BRANCH_IS_DIRTY" ]; then
s+="⚡"
2010-12-05 12:50:00 +01:00
fi
s+=")"
printf " %s%s" "%{${fg[yellow]}%}" $s
fi