Disabling zprezto’s git prompt for large repositories

At work we have a very large and highly active repository which contains the majority of our company’s code. Despite regular pruning and garbage collection, this repo can get rather slow, and the asynchronous git commands run by zprezto often get in the way of actual work, like commits, by holding locks at inopportune times.

Thus, selectively disabling the git prompt for some repositories makes a lot of sense, as the cost outweighs the benefit if it’s constantly getting in the way.

I couldn’t find direct instructions for doing this online, but fortunately the code is easy to parse; there’s a check for a git config option here.

As git configuration can be on a per-repository basis, all you need to do is run the following command from your giant repo to disable the git prompt:

git config --bool prompt.showinfo false

And you’ll still see the git status information on other repositories without this config option.

Note, this will obviously work only for themes that use the built-in git module, but that should be most of them.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.