File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,8 @@ Add to the `~/.bashrc`:
127
127
128
128
# GIT_PROMPT_SHOW_UPSTREAM=1 # uncomment to show upstream tracking branch
129
129
# GIT_PROMPT_SHOW_UNTRACKED_FILES=all # can be no, normal or all; determines counting of untracked files
130
+
131
+ # GIT_PROMPT_SHOW_CHANGED_FILES_COUNT=0 # uncomment to avoid printing the number of changed files
130
132
131
133
# GIT_PROMPT_STATUS_COMMAND=gitstatus_pre-1.7.10.sh # uncomment to support Git older than 1.7.10
132
134
Original file line number Diff line number Diff line change @@ -470,6 +470,12 @@ function updatePrompt() {
470
470
export __GIT_PROMPT_SHOW_UNTRACKED_FILES=${GIT_PROMPT_SHOW_UNTRACKED_FILES}
471
471
fi
472
472
473
+ if [ -z " ${GIT_PROMPT_SHOW_CHANGED_FILES_COUNT} " ]; then
474
+ export __GIT_PROMPT_SHOW_CHANGED_FILES_COUNT=1
475
+ else
476
+ export __GIT_PROMPT_SHOW_CHANGED_FILES_COUNT=${GIT_PROMPT_SHOW_CHANGED_FILES_COUNT}
477
+ fi
478
+
473
479
local GIT_INDEX_PRIVATE=" $( createPrivateIndex) "
474
480
# important to define GIT_INDEX_FILE as local: This way it only affects this function (and below) - even with the export afterwards
475
481
local GIT_INDEX_FILE
@@ -513,7 +519,7 @@ function updatePrompt() {
513
519
v=" \$ GIT_$1 $2 "
514
520
fi
515
521
if eval " test $v " ; then
516
- if [[ $# -lt 2 || " $3 " != ' -' ]]; then
522
+ if [[ $# -lt 2 || " $3 " != ' -' ]] && [[ " x $__GIT_PROMPT_SHOW_CHANGED_FILES_COUNT " == " x1 " || " x $1 " == " xREMOTE " ]] ; then
517
523
__add_status " \$ GIT_PROMPT_$1 \$ GIT_$1 \$ ResetColor"
518
524
else
519
525
__add_status " \$ GIT_PROMPT_$1 \$ ResetColor"
You can’t perform that action at this time.
0 commit comments