summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Attali <jeremy.attali@gmail.com>2013-04-22 10:59:08 +0200
committerJeremy Attali <jeremy.attali@gmail.com>2013-04-22 10:59:08 +0200
commite41714d72c6c5629efe632b1052b590f5f8905c5 (patch)
treef37769a91f87f78091613b8392b1031a18afd815
parent85426a57a2561f675a6ad51754d6687c3ec571c2 (diff)
downloadzsh-e41714d72c6c5629efe632b1052b590f5f8905c5.tar.gz
zsh-e41714d72c6c5629efe632b1052b590f5f8905c5.tar.bz2
zsh-e41714d72c6c5629efe632b1052b590f5f8905c5.zip
Added option to allow untracked files as non dirty
In this commit, the option only works for git but it should not be to hard for someone who knows svn to so the same. This commit is largely inspired by @yoavweiss, I only added an option to use it.
-rw-r--r--lib/git.zsh6
-rw-r--r--templates/zshrc.zsh-template5
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/git.zsh b/lib/git.zsh
index 76fe9b142..5f8453112 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -15,7 +15,11 @@ parse_git_dirty() {
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
fi
- GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
+ if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" != "true" ]]; then
+ GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
+ else
+ GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} -uno 2> /dev/null | tail -n1)
+ fi
if [[ -n $GIT_STATUS && "$GIT_STATUS" != "$CLEAN_MESSAGE" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
index 2ea9934af..58f193550 100644
--- a/templates/zshrc.zsh-template
+++ b/templates/zshrc.zsh-template
@@ -29,6 +29,11 @@ ZSH_THEME="robbyrussell"
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"
+# Uncomment following line if you want to disable marking untracked files under
+# VCS as dirty. This makes repository status check for large repositories much,
+# much faster.
+# DISABLE_UNTRACKED_FILES_DIRTY="true"
+
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)