Git completion __git_ps1 really slow on Mac
I've had __git_ps1
in my bash prompt for a while, but just recently (I noticed it after I did some messing around with Homebrew and rbenv), it has slowed down my prompt horribly. When I'm in a git directory I have to wait 3-4 seconds after every command for the prompt to appear.
If I just mash return and watch the Activity Monitor, it shows that distnoted and Finder are using more CPU than normal during the delay. Could something git-completion.bash is doing be triggering a notification to Finder? Maybe it involves folder actions or something?
It turned out to be a three-way interaction: rbenv was slowing down the rubygems version of the hub gem, which was aliased to git so it was slowing down __git_ps1. Switching to the new standalone version of hub fixed my problem.