Download:
child 39:06ada8ea9a31
parent 37:3eba5c29ae0d
38:aeaac3ebe25e
Anton Shestakov <engored@ya.ru>, Wed, 27 Aug 2014 21:54:16 +0900
Show current git hash.

1 файлов изменено, 2 вставок(+), 1 удалений(-) [+]
.bash_prompt file | annotate | diff | comparison | revisions
--- a/.bash_prompt Wed Aug 27 16:34:44 2014 +0900
+++ b/.bash_prompt Wed Aug 27 21:54:16 2014 +0900
@@ -69,6 +69,7 @@
if [[ $GIT_TRACKED ]] ; then
local GIT_STATUS=$(LC_ALL=C git status 2>/dev/null)
local GIT_BRANCH=$(grep -Po '(?<=On branch ).*$' <<< "$GIT_STATUS")
+ local GIT_REV=$(LC_ALL=C git rev-parse --short HEAD 2>/dev/null)
if [[ $GIT_STATUS == *'Your branch is behind'* ]]; then
local GIT_UPDATE="$R^"
@@ -80,7 +81,7 @@
local GIT_UNSTAGED="$P?"
fi
- local GIT_INFO=" ${G}${GIT_BRANCH}±${GIT_STAGED}${GIT_UNSTAGED}${GIT_UPDATE}${RESET}"
+ local GIT_INFO=" ${G}${GIT_BRANCH}±${GIT_REV}${GIT_STAGED}${GIT_UNSTAGED}${GIT_UPDATE}${RESET}"
fi
fi