bin/git_prompt_status @ 187f95ce4c85

Git fish prompt.
author Steve Losh <steve@stevelosh.com>
date Fri, 08 Jun 2012 13:34:19 -0400
parents (none)
children 1a4e4c34085d
#!/usr/bin/env zsh

INDEX=$(git status --porcelain 2> /dev/null)
STATUS=""


if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
    STATUS="C$STATUS"
fi

if $(echo "$INDEX" | grep '^.[MD] ' &> /dev/null); then
    STATUS="?$STATUS"
elif $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
    STATUS="?$STATUS"
fi

if $(echo "$INDEX" | grep '^[AMDR]. ' &> /dev/null); then
    STATUS="!$STATUS"
fi

echo -n $STATUS