From 50b729c0c03fba2275a74d5c4e8018616ccc4eb3 Mon Sep 17 00:00:00 2001 From: Andrey Akinshin Date: Sun, 17 Jun 2018 17:53:01 +0300 Subject: [PATCH] agnoster: speedup for repos with enabled hide-dirty For huge repos, status checking can take many seconds. It's pretty annoying to have such delay on each prompt message inside such repo. agnoster uses parse_git_drity which respect the oh-my-zsh.hide-dirty flag. Thus, we don't perform an expensive check in this case. However, it doesn't solve the original problem because we still have a delay because of check-for-changes. The line should be executed only for dirty repos. --- themes/agnoster.zsh-theme | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index b0a794f4d..e8ecad800 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -117,7 +117,9 @@ prompt_git() { zstyle ':vcs_info:*' enable git zstyle ':vcs_info:*' get-revision true - zstyle ':vcs_info:*' check-for-changes true + if [[ -n $dirty ]]; then + zstyle ':vcs_info:*' check-for-changes true + fi zstyle ':vcs_info:*' stagedstr '✚' zstyle ':vcs_info:*' unstagedstr '●' zstyle ':vcs_info:*' formats ' %u%c'