This commit is contained in:
Jacobi Carter 2012-10-21 16:47:53 -05:00
parent d810ccc293
commit 080393ed9e
2 changed files with 6 additions and 1 deletions

View file

@ -21,6 +21,7 @@
cat = show
list = show
ls = show
subup = submodule update --init --recursive
untrack-ignored = !git-untracked-ignored
info = !git-info

View file

@ -68,6 +68,7 @@ ZSH_THEME_GIT_PROMPT_MODIFIED="!"
ZSH_THEME_GIT_PROMPT_DELETED="-"
ZSH_THEME_GIT_PROMPT_UNMERGED="&"
ZSH_THEME_GIT_PROMPT_RENAMED=">"
ZSH_THEME_GIT_PROMPT_SUBMODULE="_"
git_prompt_status() {
INDEX=$(git status --porcelain 2> /dev/null)
STATUS=""
@ -97,6 +98,9 @@ git_prompt_status() {
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
if $(cd "$1" ; git submodule status --recursive | egrep '^(\+|-)' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_SUBMODULE$STATUS"
fi
echo $STATUS
}
function updateprompt () {
@ -158,7 +162,7 @@ function updateprompt () {
stashes=$(git stash list 2>/dev/null | wc -l)
stashpart="${RESETCOLOR}${GRAY}(${GREEN}${stashes}${GRAY} stashed)${RESETCOLOR}"
fi
local stats="$(git_prompt_status)"
local stats="$(git_prompt_status "${repodir}")"
PROMPT=${RESETCOLOR}${HOSTCOLOR}$'%n@'${LHOSTNAME}${BLACKCOLOR}':'${PATHCOLOR}"${reponame} ${RED}${branch}${YELLOW}${stats}${BLACKCOLOR}${additional} ${PATHCOLOR}"$'%45<...<'"${repopath}"' %(?..'${BOLDERRORCOLOR}$')%(!.#.$) '${RESETCOLOR}
RPROMPT=${RESETCOLOR}${stashpart}${remotepart}$'%1(j.'${JOBCOLOR}$'[%j].)%(?..'${ERRORCOLOR}$'[%?])'${CLOCKCOLOR}$'[%t]'${RESETCOLOR}
cdpath=( . "$repodir" ~ ~/Giftikigit ~/launchrockgit ~/loagit ~/git .. )