Download:
child 58:0c34db2e6c55
parent 56:49435f917654
57:c40d524fc90c
Anton Shestakov <engored@ya.ru>, Mon, 08 Sep 2014 00:09:14 +0900
Color detached differently.

1 файлов изменено, 6 вставок(+), 1 удалений(-) [+]
.bash_prompt file | annotate | diff | comparison | revisions
--- a/.bash_prompt Sun Sep 07 18:58:52 2014 +0900
+++ b/.bash_prompt Mon Sep 08 00:09:14 2014 +0900
@@ -121,6 +121,11 @@
local AHEAD="$Y^"
[[ $STATUS =~ ahead[^$'\n']+([0-9]+)' 'commit ]] && AHEAD+=${BASH_REMATCH[1]}
fi
+ if [[ $STATUS == *detached* ]] ; then
+ REV="$P$REV"
+ else
+ REV="$G$REV"
+ fi
if [[ $STATUS == *'Changes to be committed'* ]] ; then
local STAGED="$R!"
fi
@@ -128,7 +133,7 @@
local UNSTAGED="$P?"
fi
- GIT_INFO=" ${G}${BRANCH}±${P}${REV}${BEHIND}${AHEAD}${STAGED}${UNSTAGED}${RESET}"
+ GIT_INFO=" ${G}${BRANCH}±${REV}${BEHIND}${AHEAD}${STAGED}${UNSTAGED}${RESET}"
}
# first find prompt in hgrc, then check it's actually enabled