Disabling altogether on individual slow repositories
I use gitstatus with Windows Subsystem for Linux, where accessing Windows disks is pretty slow. I have a couple of repositories still on Windows disks as I need them accessible to native Windows tools, which means my bash prompt can slow to 10 seconds or more evaluating the git status.
I've set the options mentioned in https://github.com/romkatv/gitstatus/issues/231#issuecomment-821024952:
git config --local bash.showUntrackedFiles false
git config --local bash.showDirtyState false
...which reduces the wait to about 3-4 seconds on a particularly large repository, but that's still pretty painful for interacting with it.
Can I opt-out one or more repository paths completely though config, or do I need to get my hands dirty making the bash prompt conditional on $PWD or similar?
You'll have to edit the bash code for this.
I've ended up modifying my $PROMPT_COMMAND to point gitstatus_prompt_update at an empty directory when inside problematic repositories defined with a custom config option, which seems to work well enough:
_prompt_command() {
...
gspwd="$PWD"
[ "$(git config bash.show)" = "false" ] && gspwd=/var/empty
gitstatus_prompt_update -d "$gspwd"
}
PROMPT_COMMAND=_prompt_command
To disable all status reporting for the current repository:
$ git config --local bash.show false