Download:
child 67:0a7e0a69a670
parent 65:f9947eb0c34a
66:584e8e0b08ee
Anton Shestakov <engored@ya.ru>, Sun, 21 Dec 2014 16:46:36 +0800
git prompt: mark non-empty stash

1 файлов изменено, 5 вставок(+), 1 удалений(-) [+]
.bash_prompt file | annotate | diff | comparison | revisions
--- a/.bash_prompt Sat Nov 29 13:38:16 2014 +0800
+++ b/.bash_prompt Sun Dec 21 16:46:36 2014 +0800
@@ -107,6 +107,7 @@
local STATUS=$(LC_ALL=C git status 2>/dev/null)
local BRANCH=$(grep -Po '(?<=On branch ).*$' <<< "$STATUS")
local REV=$(LC_ALL=C git rev-parse --short HEAD 2>/dev/null)
+ local STASH=$(LC_ALL=C git stash list 2>/dev/null)
if [[ $STATUS == *'Your branch is behind'* ]] ; then
local BEHIND="$R^"
@@ -127,8 +128,11 @@
if [[ $STATUS == *'Changes not staged'* ]] ; then
local UNSTAGED="$P?"
fi
+ if [[ ! -z $STASH ]] ; then
+ STASH='S'
+ fi
- GIT_INFO=" ${G}${BRANCH}±${REV}${BEHIND}${AHEAD}${STAGED}${UNSTAGED}${RESET}"
+ GIT_INFO=" ${G}${BRANCH}±${REV}${BEHIND}${AHEAD}${STAGED}${UNSTAGED}${C}${STASH}${RESET}"
}
# first find prompt in hgrc, then check it's actually enabled