File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,8 @@ git clone https://github.com/magicmonty/bash-git-prompt.git .bash-git-prompt
124
124
# GIT_PROMPT_FETCH_REMOTE_STATUS=0 # uncomment to avoid fetching remote status
125
125
126
126
# GIT_PROMPT_SHOW_UPSTREAM=1 # uncomment to show upstream tracking branch
127
-
127
+ # GIT_SHOW_UNTRACKED_FILES=all # can be no, normal or all; determines counting of untracked files
128
+
128
129
# GIT_PROMPT_STATUS_COMMAND=gitstatus_pre-1.7.10.sh # uncomment to support Git older than 1.7.10
129
130
130
131
# GIT_PROMPT_START=... # uncomment for custom prompt start sequence
@@ -136,6 +137,10 @@ git clone https://github.com/magicmonty/bash-git-prompt.git .bash-git-prompt
136
137
source ~ /.bash-git-prompt/gitprompt.sh
137
138
```
138
139
140
+ You can set the ` GIT_SHOW_UNTRACKED_FILES ` variable to ` no ` or ` normal ` to speed things up if you have lots of
141
+ untracked files in your repository. This can be the case for build systems that put their build artifacts in
142
+ the subdirectory structure of the git repository.
143
+
139
144
- ` cd ` to a git repository and test it!
140
145
141
146
#### Themes
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- # -*- coding: UTF -8 -*-
2
+ # -*- coding: utf -8 -*-
3
3
# gitstatus.sh -- produce the current git repo status on STDOUT
4
4
# Functionally equivalent to 'gitstatus.py', but written in bash (not python).
5
5
#
@@ -15,7 +15,11 @@ if [ -z "${__GIT_PROMPT_DIR}" ]; then
15
15
__GIT_PROMPT_DIR=" $( cd -P " $( dirname " ${SOURCE} " ) " && pwd ) "
16
16
fi
17
17
18
- gitstatus=$( LC_ALL=C git status --untracked-files=all --porcelain --branch )
18
+ if [ -z " ${GIT_SHOW_UNTRACKED_FILES} " ]; then
19
+ GIT_SHOW_UNTRACKED_FILES=" all"
20
+ fi
21
+
22
+ gitstatus=$( LC_ALL=C git status --untracked-files=${GIT_SHOW_UNTRACKED_FILES} --porcelain --branch )
19
23
20
24
# if the status is fatal, exit now
21
25
[[ " $? " -ne 0 ]] && exit 0
You can’t perform that action at this time.
0 commit comments