# HG changeset patch # User Anton Shestakov <engored@ya.ru> # Date 1409144056 -32400 # Node ID aeaac3ebe25e576146b85488a50016bcc6c81625 # Parent 3eba5c29ae0d917dd6069b06fbcd0484f91b6fcf Show current git hash. diff -r 3eba5c29ae0d -r aeaac3ebe25e .bash_prompt --- 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