Download:
child 34:6d42e8d89e7e
parent 32:ec26c70bf440
33:b0de9677e28d
Anton Shestakov <engored@ya.ru>, Wed, 27 Aug 2014 03:39:55 +0900
.bash_prompt cleanup, unification.

1 файлов изменено, 3 вставок(+), 4 удалений(-) [+]
.bash_prompt file | annotate | diff | comparison | revisions
--- a/.bash_prompt Mon Aug 25 14:54:43 2014 +0900
+++ b/.bash_prompt Wed Aug 27 03:39:55 2014 +0900
@@ -12,7 +12,6 @@
local P="\[\e[1;35m\]"
local C="\[\e[1;36m\]"
- local PROMPT_TEMPLATE="${P}{branch|quiet}☿{rev}{$R{update}}{$G+{rev|merge}}$R{status|modified}${RESET}"
local TIME="${G}\t${RESET}"
if [[ ${EUID} == 0 ]] ; then
@@ -35,7 +34,7 @@
done
if [[ "$HG_TRACKED" ]] ; then
- local SUM=$(LC_ALL=C hg sum)
+ local SUM=$(LC_ALL=C hg sum 2>/dev/null)
local PARENTS=($(grep -Po '(?<=parent: ).*(?=:)' <<< "$SUM"))
local BRANCH=$(grep -Po '(?<=branch: ).*$' <<< "$SUM")
local COMMIT=$(grep -Po '(?<=commit: ).*$' <<< "$SUM")
@@ -68,8 +67,8 @@
local HG_INFO=" ${P}${BRANCH}☿${REV}${R}${UPDATE}${G}${MERGEREV}${R}${COMMIT}${RESET}"
fi
if [[ "$GIT_TRACKED" ]] ; then
- local GIT_STATUS=$(git status 2>/dev/null)
- local GIT_BRANCH=$(grep 'On branch' <<< "$GIT_STATUS" | cut -d' ' -f3-)
+ local GIT_STATUS=$(LC_ALL=C git status 2>/dev/null)
+ local GIT_BRANCH=$(grep -Po '(?<=On branch ).*$' <<< "$GIT_STATUS")
if [[ $(grep "Your branch is behind" <<< "$GIT_STATUS") ]]; then
local GIT_UPDATE="$R^"