Download:
child 69:3e6ac54990dd
parent 67:0a7e0a69a670
68:c90c3504fbb3
Anton Shestakov <engored@ya.ru>, Sun, 21 Dec 2014 17:16:28 +0800
git prompt: show merges (without conflict)

1 файлов изменено, 5 вставок(+), 1 удалений(-) [+]
.bash_prompt file | annotate | diff | comparison | revisions
--- a/.bash_prompt Sun Dec 21 17:15:55 2014 +0800
+++ b/.bash_prompt Sun Dec 21 17:16:28 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 MERGEREV=$(LC_ALL=C git rev-parse --short MERGE_HEAD 2>/dev/null)
local STASH=$(LC_ALL=C git stash list 2>/dev/null)
if [[ $STATUS == *'Your branch is behind'* ]] ; then
@@ -128,11 +129,14 @@
if [[ $STATUS == *'Changes not staged'* ]] ; then
local UNSTAGED="$P?"
fi
+ if [[ $STATUS == *'All conflicts fixed but you are still merging.'* ]] ; then
+ local MERGE="$B+$MERGEREV"
+ fi
if [[ ! -z $STASH ]] ; then
STASH='S'
fi
- GIT_INFO=" ${G}${BRANCH}±${REV}${BEHIND}${AHEAD}${STAGED}${UNSTAGED}${C}${STASH}${RESET}"
+ GIT_INFO=" ${G}${BRANCH}±${REV}${MERGE}${BEHIND}${AHEAD}${STAGED}${UNSTAGED}${C}${STASH}${RESET}"
}
# first find prompt in hgrc, then check it's actually enabled