Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added count_only option

  • Loading branch information...
commit dccca3f4a4bfb9d7cb2daea42233f38c3003fd1e 1 parent 947179b
@thge authored
Showing with 11 additions and 4 deletions.
  1. +1 −1  git-prompt.conf
  2. +10 −3 git-prompt.sh
View
2  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
View
13 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}
Please sign in to comment.
Something went wrong with that request. Please try again.