olivierverdier / zsh-git-prompt

Informative git prompt for zsh
MIT License
1.72k stars 395 forks source link

Improve performance by removing unnecessary calls to Git #70

Closed ToonSpin closed 9 years ago

ToonSpin commented 9 years ago

I've found that the changes in this PR make things more than twice as fast inside a Git repo.

There are two changes here:

  1. Remove a call to precmd_update_git_vars inside git_super_status: not needed as it is called inside the precmd hook each time the prompt is computed
  2. Add the -uno flag to the git status call; what this does is keep Git from checking for untracked files, which you've already done in the git diff call a few lines above the call.
ToonSpin commented 9 years ago

As it turns out, the "-uno" flag doesn't remove redundant information at all, this PR would have removed the information about untracked files.