diff --git a/README.md b/README.md index d1b66e8..5d60f1b 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ cp gitprompt.fish ~/.config/fish/functions/fish_prompt.fish # GIT_PROMPT_IGNORE_SUBMODULES=1 # uncomment to avoid searching for changed files in submodules # GIT_PROMPT_SHOW_UPSTREAM=1 # uncomment to show upstream tracking branch - # GIT_PROMPT_SHOW_UNTRACKED_FILES=all # can be no, normal or all; determines counting of untracked files + # GIT_PROMPT_SHOW_UNTRACKED_FILES=normal # can be no, normal or all; determines counting of untracked files # GIT_PROMPT_SHOW_CHANGED_FILES_COUNT=0 # uncomment to avoid printing the number of changed files @@ -169,7 +169,8 @@ cp gitprompt.fish ~/.config/fish/functions/fish_prompt.fish You can set the `GIT_PROMPT_SHOW_UNTRACKED_FILES` variable to `no` or `normal` to speed things up if you have lots of untracked files in your repository. This can be the case for build systems that put their build artifacts in -the subdirectory structure of the git repository. +the subdirectory structure of the git repository. Setting it to `all` will count all untracked files, including files +listed in .gitignore. - `cd` to a git repository and test it! diff --git a/gitprompt.sh b/gitprompt.sh index 0617867..9d90ec4 100755 --- a/gitprompt.sh +++ b/gitprompt.sh @@ -488,7 +488,7 @@ function updatePrompt() { export __GIT_PROMPT_IGNORE_SUBMODULES=${GIT_PROMPT_IGNORE_SUBMODULES} if [ -z "${GIT_PROMPT_SHOW_UNTRACKED_FILES}" ]; then - export __GIT_PROMPT_SHOW_UNTRACKED_FILES=all + export __GIT_PROMPT_SHOW_UNTRACKED_FILES=normal else export __GIT_PROMPT_SHOW_UNTRACKED_FILES=${GIT_PROMPT_SHOW_UNTRACKED_FILES} fi diff --git a/gitstatus.sh b/gitstatus.sh index ce7d39f..07b6b6c 100755 --- a/gitstatus.sh +++ b/gitstatus.sh @@ -21,7 +21,7 @@ else _ignore_submodules= fi -gitstatus=$( LC_ALL=C git status ${_ignore_submodules} --untracked-files=${__GIT_PROMPT_SHOW_UNTRACKED_FILES:-all} --porcelain --branch ) +gitstatus=$( LC_ALL=C git status ${_ignore_submodules} --untracked-files=${__GIT_PROMPT_SHOW_UNTRACKED_FILES:-normal} --porcelain --branch ) # if the status is fatal, exit now [[ "$?" -ne 0 ]] && exit 0