summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonid Volnitsky <Leonid@Volnitsky.com>2008-06-15 08:36:08 +0300
committerLeonid Volnitsky <Leonid@Volnitsky.com>2008-06-15 08:53:24 +0300
commit2973749097cd6b6c60acd96a2440d131aa4a4495 (patch)
treea0c2122af92a9c21fd6e4b23e3ebc0bb0130940e
parentREADME (diff)
downloadgit-prompt-2973749097cd6b6c60acd96a2440d131aa4a4495.tar.gz
git-prompt-2973749097cd6b6c60acd96a2440d131aa4a4495.tar.bz2
git-prompt-2973749097cd6b6c60acd96a2440d131aa4a4495.zip
also added raw head disp
-rwxr-xr-xprompt15
1 files changed, 7 insertions, 8 deletions
diff --git a/prompt b/prompt
index d10ac3b..7b4a5dd 100755
--- a/prompt
+++ b/prompt
@@ -276,8 +276,6 @@ PROMPT_COMMAND='
"
`
-
-
### OP
unset op
@@ -325,16 +323,17 @@ PROMPT_COMMAND='
eval git_color="\${git_$status}"
### head
- set `git-name-rev HEAD`
- head="$2"
+ head=`git-name-rev --name-only HEAD 2>/dev/null`
+ head_rev=`git-rev-parse HEAD 2>/dev/null`
+ head_rev=${head_rev:0:6}
### compose local label
[[ $clean == "clean" ]] || sep=":"
- tail_local="$head${op+/$op}$sep$git_added$git_added_files$git_modified$git_modified_files$git_untracked$git_untracked_files$git_color"
+ tail_local="($head $white$head_rev${op+ / $op}$git_color)$sep$git_added$git_added_files$git_modified$git_modified_files$git_untracked$git_untracked_files$git_color"
- ### fringes
+ ### fringes (added depended on location)
head_local="${head_local+$git_color $head_local\n}"
- tail_local="${tail_local+$git_color ($tail_local)}${dir_color}"
+ tail_local="${tail_local+$git_color $tail_local}${dir_color}"
unset branch status git_color clean added modified untracked sep
unset git_modified_files
@@ -346,7 +345,7 @@ PROMPT_COMMAND='
# PS1="$label$rc'$color_who_where$dir_color'${head:10*(${#PWD}<max)}${PWD:(${#PWD}>max)*(${#PWD}-max):max}> '$colors_reset'"
- PS1="$head_local$colors_reset$label$rc'$color_who_where$dir_color'\w$tail_local'$dir_color' > '$colors_reset'"
+ PS1="$head_local$colors_reset$label$rc'$color_who_where$dir_color'\w$tail_local'$dir_color'> '$colors_reset'"
unset head_local tail_local
'