summaryrefslogtreecommitdiff
path: root/bash-git-prompt.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-05-23 15:06:41 +0200
committerErich Eckner <git@eckner.net>2016-05-23 15:06:41 +0200
commit6d4a0fb0cd1742dac93cedeb4edff1438afc6a16 (patch)
tree891adf894bc4afd22206090eb4754ae11de69eb8 /bash-git-prompt.in
parentc0a283cc3f06e89c3ce1dd144d08aaa53ed374b7 (diff)
downloadbash-git-prompt-6d4a0fb0cd1742dac93cedeb4edff1438afc6a16.tar.xz
schönerer Promt während Rebase (und Merge?)
Diffstat (limited to 'bash-git-prompt.in')
-rwxr-xr-xbash-git-prompt.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/bash-git-prompt.in b/bash-git-prompt.in
index a8ef63b..c9ac219 100755
--- a/bash-git-prompt.in
+++ b/bash-git-prompt.in
@@ -19,7 +19,12 @@ PS1="$PS1Start"
if status=$(git status --porcelain 2> /dev/null)
then
PS1="$PS1 "
- branch="$(git symbolic-ref HEAD 2> /dev/null | sed "s|^.*/||")"
+ branch="$((git symbolic-ref HEAD 2> /dev/null || git describe --always) | sed "s|^.*/||")"
+ gitDir="$(git rev-parse --show-toplevel)/$(git rev-parse --git-dir)"
+ if [ -e ${gitDir}/rebase-merge ] || [ -e ${gitDir}/rebase-apply ]
+ then
+ branch="($branch)"
+ fi
echo "$status" | grep -q "^.\S" && wtClean=false || wtClean=true
echo "$status" | grep -q "^\S" && idxClean=false || idxClean=true