git: parse_git_dirty is too slow #11968
-
When opening folders that contain large git repositories, like the linux-kernel, git_prompt_info and parse_git_dirty take >3 seconds to run. Waiting >3 seconds is pretty much unacceptable. Currently I'm using a work-around: https://gist.github.com/msabramo/2355834 |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments
-
I'd be fine with even having it's update frequency not be every second, but every XX seconds. |
Beta Was this translation helpful? Give feedback.
-
Having the same issue, there's < 30 changes in my Git Repo :( |
Beta Was this translation helpful? Give feedback.
-
Yep, my change list is usually fairly small too so this would be nice to get boosted. |
Beta Was this translation helpful? Give feedback.
-
I'm having the same issue, again with a small number of local changes in the git repo. Made local modifications to workaround for now but using a plugin manager, so changes would be wiped out on next update :( |
Beta Was this translation helpful? Give feedback.
-
You can limit the git command with a timeout, for example: Lines 7 to 11 in f6bc949 - GIT_OPTIONAL_LOCKS=0 command git "$@"
+ GIT_OPTIONAL_LOCKS=0 command timeout 1s git "$@" |
Beta Was this translation helpful? Give feedback.
-
Note that you can disable But yeah, it should be made faster. |
Beta Was this translation helpful? Give feedback.
-
Having this issue as well. @mcornella idea of the git config option to disable this feature works as a workaround on my end though thankfully. |
Beta Was this translation helpful? Give feedback.
-
I am having the same issue and @mcornella 's solution of git config works. But I would like to understand a bit more about why this works. How is the option |
Beta Was this translation helpful? Give feedback.
-
Thanks @mcornella I followed the tip of disabling checking for dirty on a big repo, I'm not really bothered as I usually check the status manually anyway, I had actually forgotten the little |
Beta Was this translation helpful? Give feedback.
-
People coming across this are also likely to want to add:
See https://unix.stackexchange.com/questions/565905/oh-my-zshs-prompt-is-slow-how-to-fix-this |
Beta Was this translation helpful? Give feedback.
-
or in case of setting this globally:
|
Beta Was this translation helpful? Give feedback.
People coming across this are also likely to want to add:
See https://unix.stackexchange.com/questions/565905/oh-my-zshs-prompt-is-slow-how-to-fix-this