From 987b895e6660c3372f5eaf5f0586d2cf7180c247 Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Sun, 15 Jun 2008 13:34:13 +0300 Subject: replace git-name-rev (which was incorrectly showing branch name) with branch+head_tail --- prompt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/prompt b/prompt index 8597f8f..bf492d0 100755 --- a/prompt +++ b/prompt @@ -319,8 +319,11 @@ PROMPT_COMMAND=' eval git_color="\${git_$status}" git_color=${git_color:-$WHITE} - ### head + ### branch head=`git-name-rev --name-only HEAD 2>/dev/null` + head_tail=`echo $head | sed 's/[^^~]*//'` # we cut head to leave only ^~, and reattach to branch name + branch=${branch/master/M}$head_tail + head_rev=`git-rev-parse HEAD 2>/dev/null` head_rev=${head_rev/HEAD/} head_rev=${head_rev:0:6} @@ -332,7 +335,7 @@ PROMPT_COMMAND=' file_list+="${git_modified_files+$git_modified$git_modified_files }" file_list+="${git_untracked_files+$git_untracked$git_untracked_files }" [[ $file_list ]] && file_list=":${file_list}" # ${+ does not works (?) - tail_local="(${head/master/m} $white$head_rev$git_color${op+ / $op}$git_color${file_list}$git_color)" + tail_local="(${branch} $white$head_rev$git_color${op+ / $op}$git_color${file_list}$git_color)" ### fringes (added depended on location) head_local="${head_local+$git_color $head_local\n}" -- cgit v1.2.3