-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git prompt is very slow #139
Comments
The slowest part on my end seems to be the one that computes the amount of commits ahead/behind the upstream at https://github.com/arialdomartini/oh-my-git/blob/master/base.sh#L91-L95. It can be dramatically improved by using this instead: if [[ $has_upstream == true ]]; then
local commits_ahead commits_behind
read -r commits_behind commits_ahead <<<$(git rev-list --left-right --count ${current_commit_hash}...${upstream} 2> /dev/null)
fi |
@arialdomartini Thanks for merging! But I've belatedly realized that, I think, there's an error there - |
@p-himik good catch! You are right. |
Executing commands on the command line takes a couple of seconds more when oh-my-git is enabled in a repository.
With oh-my-git enables running
time git st
And without oh-my-git on the same repo
Also just hitting enter on the cmd line it takes about 3 seconds for the prompt to release.
I tried in my mac terminal and iTerm2 and results were the same.
Any suggestions to fix this please.
Thank you.
The text was updated successfully, but these errors were encountered: