summaryrefslogtreecommitdiff
path: root/prompt
diff options
context:
space:
mode:
authorLeonid Volnitsky <Leonid@Volnitsky.com>2008-06-13 23:34:24 +0300
committerLeonid Volnitsky <Leonid@Volnitsky.com>2008-06-13 23:34:24 +0300
commit1f27cbd16a1161e24088cda23be472fb5906c873 (patch)
tree4abf4ea3de6992ed0bc7cce212278297a603e218 /prompt
parent1st commit (diff)
downloadgit-prompt-1f27cbd16a1161e24088cda23be472fb5906c873.tar.gz
git-prompt-1f27cbd16a1161e24088cda23be472fb5906c873.tar.bz2
git-prompt-1f27cbd16a1161e24088cda23be472fb5906c873.zip
display git branch if in git dir
Diffstat (limited to 'prompt')
-rwxr-xr-xprompt13
1 files changed, 11 insertions, 2 deletions
diff --git a/prompt b/prompt
index f103e8c..4a7b799 100755
--- a/prompt
+++ b/prompt
@@ -60,6 +60,8 @@
# git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
# }
# PS1="\w\$(parse_git_branch) $ "
+#---
+#git symbolic-ref HEAD
##################################################################### lvv Prompt
# echo "*** /etc/prompt on A, TERM=$TERM"
@@ -250,9 +252,16 @@ PROMPT_COMMAND='
front=7
head=${PWD:0:$front}"..."
- #PS1="$label$rc'$color_who_where$dir_color'${head:10*(${#PWD}<max)}${PWD:(${#PWD}>max)*(${#PWD}-max):max}> '$colors_reset'"
- PS1="$label$rc'$color_who_where$dir_color'\w> '$colors_reset'"
+ # LOCAL
+ # GIT
+ if [[ -d .git || -d ../.git || -d ../../.git ]]; then
+ local=`git branch -a |sed -n "s/^* //p"`
+ local=${local+($local)}
+ fi
+ #PS1="$label$rc'$color_who_where$dir_color'${head:10*(${#PWD}<max)}${PWD:(${#PWD}>max)*(${#PWD}-max):max}> '$colors_reset'"
+ PS1="$label$rc'$color_who_where$dir_color'\w$local> '$colors_reset'"
+ unset local
'
#echo \"$color_who_where\"
unset rc id tty bell default_user default_host