diff options
author | Thomas Geffert <thomas.geffert@arcutronix.com> | 2011-03-02 19:08:08 +0800 |
---|---|---|
committer | Leonid Volnitsky <leonid@volnitsky.com> | 2011-04-07 20:14:13 +0800 |
commit | 5dc647adfd86ab719efe146f2dfbd11fecdfff46 (patch) | |
tree | ed5710a8707c67c07675aed0d3922ea9e3ca8bb4 | |
parent | -- docs (diff) | |
download | git-prompt-5dc647adfd86ab719efe146f2dfbd11fecdfff46.tar.gz git-prompt-5dc647adfd86ab719efe146f2dfbd11fecdfff46.tar.bz2 git-prompt-5dc647adfd86ab719efe146f2dfbd11fecdfff46.zip |
added count_only option
-rw-r--r-- | git-prompt.conf | 2 | ||||
-rwxr-xr-x | git-prompt.sh | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/git-prompt.conf b/git-prompt.conf index dd88fd0..414c3d6 100644 --- a/git-prompt.conf +++ b/git-prompt.conf @@ -10,7 +10,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 ############################################################ MODULES diff --git a/git-prompt.sh b/git-prompt.sh index 7646eec..e4eb9f6 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -55,6 +55,7 @@ max_file_list_length=${max_file_list_length:-100} upcase_hostname=${upcase_hostname:-on} + count_only=${count_only:-off} aj_max=20 @@ -566,9 +567,15 @@ parse_vcs_status() { ### file list unset file_list - [[ ${added_files[0]} ]] && file_list+=" "$added_vcs_color${added_files[@]} - [[ ${modified_files[0]} ]] && file_list+=" "$modified_vcs_color${modified_files[@]} - [[ ${untracked_files[0]} ]] && file_list+=" "$untracked_vcs_color${untracked_files[@]} + if [[ $count_only = "on" ]] ; then + [[ ${added_files[0]} ]] && file_list+=" "${added_vcs_color}+${#added_files[@]} + [[ ${modified_files[0]} ]] && file_list+=" "${modified_vcs_color}*${#modified_files[@]} + [[ ${untracked_files[0]} ]] && file_list+=" "${untracked_vcs_color}?${#untracked_files[@]} + else + [[ ${added_files[0]} ]] && file_list+=" "$added_vcs_color${added_files[@]} + [[ ${modified_files[0]} ]] && file_list+=" "$modified_vcs_color${modified_files[@]} + [[ ${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} |