diff options
author | Leonid Volnitsky <Leonid@Volnitsky.com> | 2011-04-22 06:24:30 +0300 |
---|---|---|
committer | Leonid Volnitsky <Leonid@Volnitsky.com> | 2011-04-22 06:29:24 +0300 |
commit | bd894d9ffb776563ad4ffdbef2df3f4576761233 (patch) | |
tree | ce7a4673249b2d1721f62402ab728f947bb1cd0e | |
parent | rev-number (hex) now in dim (half-bright) color (diff) | |
download | git-prompt-bd894d9ffb776563ad4ffdbef2df3f4576761233.tar.gz git-prompt-bd894d9ffb776563ad4ffdbef2df3f4576761233.tar.bz2 git-prompt-bd894d9ffb776563ad4ffdbef2df3f4576761233.zip |
fixied: clean repo detection; new hexlen default=5; removed ":" before file list
-rw-r--r-- | git-prompt.conf | 3 | ||||
-rwxr-xr-x | git-prompt.sh | 10 |
2 files changed, 7 insertions, 6 deletions
diff --git a/git-prompt.conf b/git-prompt.conf index c136964..986e6af 100644 --- a/git-prompt.conf +++ b/git-prompt.conf @@ -11,7 +11,7 @@ # error_bell=off # sound terminal bell when command return code is not zero. (use setterm to set pitch and duration) # max_file_list_length=100 # in characters # count_only=off # off - display file list; on - display file count -# rawhex_len=6 # length of git rawhex revision id display (use 0 to hide it) +# rawhex_len=5 # length of git rawhex revision id display (use 0 to hide it) ############################################################ MODULES @@ -85,6 +85,7 @@ # untracked_vcs_color=BLUE # Untracked files: # op_vcs_color=MAGENTA # detached_vcs_color=RED +# hex_vcs_color=dim # :vim:ft=sh ts=8 sw=8 et: diff --git a/git-prompt.sh b/git-prompt.sh index 30ca64e..95559b8 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -6,8 +6,9 @@ ##### read config file if any. - unset dir_color rc_color user_id_color root_id_color init_vcs_color clean_vcs_color - unset modified_vcs_color added_vcs_color addmoded_vcs_color untracked_vcs_color op_vcs_color detached_vcs_color + unset dir_color rc_color user_id_color root_id_color init_vcs_color clean_vcs_color + unset modified_vcs_color added_vcs_color addmoded_vcs_color untracked_vcs_color op_vcs_color detached_vcs_color hex_vcs_color + unset rawhex_len conf=git-prompt.conf; [[ -r $conf ]] && . $conf conf=/etc/git-prompt.conf; [[ -r $conf ]] && . $conf @@ -57,7 +58,7 @@ max_file_list_length=${max_file_list_length:-100} upcase_hostname=${upcase_hostname:-on} count_only=${count_only:-off} - rawhex_len=${rawhex_len:-6} + rawhex_len=${rawhex_len:-5} aj_max=20 @@ -415,7 +416,7 @@ parse_git_status() { git status 2>/dev/null | sed -n ' s/^# On branch /branch=/p - s/^nothing to commit (working directory clean)/clean=clean/p + s/^nothing to commit/clean=clean/p s/^# Initial commit/init=init/p /^# Changes to be committed:/,/^# [A-Z]/ { @@ -585,7 +586,6 @@ parse_vcs_status() { [[ ${untracked_files[0]} ]] && file_list+=" "$untracked_vcs_color${untracked_files[@]} fi [[ ${vim_files} ]] && file_list+=" "${RED}vim:${vim_files} - file_list=${file_list:+:$file_list} if [[ ${#file_list} -gt $max_file_list_length ]] ; then file_list=${file_list:0:$max_file_list_length} |