Download:
child 89:a0fcf563ed03
parent 87:707b477798fa
88:f5cd956da0c3
Anton Shestakov <engored@ya.ru>, Tue, 17 Feb 2015 15:05:53 +0800
git prompt: better regexes

1 файлов изменено, 2 вставок(+), 2 удалений(-) [+]
.bash_prompt file | annotate | diff | comparison | revisions
--- a/.bash_prompt Sun Feb 15 23:38:25 2015 +0800
+++ b/.bash_prompt Tue Feb 17 15:05:53 2015 +0800
@@ -112,11 +112,11 @@
if [[ $STATUS == *'Your branch is behind'* ]] ; then
local BEHIND="$R^"
- [[ $STATUS =~ behind[^$'\n']+([0-9]+)' 'commit ]] && BEHIND+=${BASH_REMATCH[1]}
+ [[ $STATUS =~ 'behind '[^$'\n']+' '([0-9]+)' commit' ]] && BEHIND+=${BASH_REMATCH[1]}
fi
if [[ $STATUS == *'Your branch is ahead'* ]] ; then
local AHEAD="$Y^"
- [[ $STATUS =~ ahead[^$'\n']+([0-9]+)' 'commit ]] && AHEAD+=${BASH_REMATCH[1]}
+ [[ $STATUS =~ 'ahead '[^$'\n']+' '([0-9]+)' commit' ]] && AHEAD+=${BASH_REMATCH[1]}
fi
if [[ $STATUS == *detached* ]] ; then
REV="$P$REV"