diff options
author | Martin Meredith <martinmeredith@protecinnovations.co.uk> | 2012-04-18 11:45:22 +0100 |
---|---|---|
committer | Martin Meredith <martinmeredith@protecinnovations.co.uk> | 2012-04-18 11:45:22 +0100 |
commit | 8ce35df2c5aa333dd394f6e7e2700538c10d9a90 (patch) | |
tree | 99be3c099f7008a2f58bd1e43a3efe9d9012abea | |
parent | 1120f973054836eeb53750f57d69fbec41a340dc (diff) | |
download | zsh-8ce35df2c5aa333dd394f6e7e2700538c10d9a90.tar.gz zsh-8ce35df2c5aa333dd394f6e7e2700538c10d9a90.tar.bz2 zsh-8ce35df2c5aa333dd394f6e7e2700538c10d9a90.zip |
Add option to disable status notification
For certain git repositories, this slows down usage
of the shell horifically.
This option can be set with
git config --add oh-my-zsh.hide-status 1
which will disable checking/showing the status notification
-rw-r--r-- | lib/git.zsh | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/git.zsh b/lib/git.zsh index fb4ad8ca6..6c878afff 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -8,13 +8,15 @@ function git_prompt_info() { # Checks if working tree is dirty parse_git_dirty() { local SUBMODULE_SYNTAX='' - if [[ $POST_1_7_2_GIT -gt 0 ]]; then - SUBMODULE_SYNTAX="--ignore-submodules=dirty" - fi - if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then - echo "$ZSH_THEME_GIT_PROMPT_DIRTY" - else - echo "$ZSH_THEME_GIT_PROMPT_CLEAN" + if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then + if [[ $POST_1_7_2_GIT -gt 0 ]]; then + SUBMODULE_SYNTAX="--ignore-submodules=dirty" + fi + if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then + echo "$ZSH_THEME_GIT_PROMPT_DIRTY" + else + echo "$ZSH_THEME_GIT_PROMPT_CLEAN" + fi fi } |