diff options
author | Leonid Volnitsky <Leonid@Volnitsky.com> | 2008-06-15 09:56:28 +0300 |
---|---|---|
committer | Leonid Volnitsky <Leonid@Volnitsky.com> | 2008-06-15 12:39:07 +0300 |
commit | 6f04a2d02d0e304627d3f5d9e834e0d4b9c524ef (patch) | |
tree | ff1bf5f21389ff8cf425d3e8821aba55864920b5 /prompt | |
parent | also added raw head disp (diff) | |
download | git-prompt-6f04a2d02d0e304627d3f5d9e834e0d4b9c524ef.tar.gz git-prompt-6f04a2d02d0e304627d3f5d9e834e0d4b9c524ef.tar.bz2 git-prompt-6f04a2d02d0e304627d3f5d9e834e0d4b9c524ef.zip |
file list composition refactored
Diffstat (limited to 'prompt')
-rwxr-xr-x | prompt | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -321,6 +321,7 @@ PROMPT_COMMAND=' # at least one should be set : ${status?prompt internal error: git status} eval git_color="\${git_$status}" + git_color=${git_color:-$WHITE} ### head head=`git-name-rev --name-only HEAD 2>/dev/null` @@ -328,14 +329,20 @@ PROMPT_COMMAND=' head_rev=${head_rev:0:6} ### compose local label - [[ $clean == "clean" ]] || sep=":" - 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" + + unset file_list + file_list+="${git_added_files+$git_added$git_added_files }" + 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 $white$head_rev${op+ / $op}$git_color)${file_list}" ### fringes (added depended on location) head_local="${head_local+$git_color $head_local\n}" tail_local="${tail_local+$git_color $tail_local}${dir_color}" - unset branch status git_color clean added modified untracked sep + unset branch status git_color clean added modified untracked sep file_list unset git_modified_files unset git_untracked_files unset git_added_files |