Skip to content
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_status_summary extremely slow for large repos #172

Open
pokowaka opened this issue Aug 28, 2020 · 4 comments · May be fixed by #173
Open

git_status_summary extremely slow for large repos #172

pokowaka opened this issue Aug 28, 2020 · 4 comments · May be fixed by #173

Comments

@pokowaka
Copy link
Contributor

Large repos can turn the command prompt unresponsive for long stretches of time.

This is due to the fact that the call to

git status --porcelain -b

can take a large amount of time:

 time  git status --porcelain -b
--- some data --
real    4m1.149s
user    3m59.189s
sys     0m1.948s

This makes oh-my-bash unusable. The prompt should ideally not be delayed for more than 0.1s. See https://www.nngroup.com/articles/response-times-3-important-limits/

pokowaka pushed a commit to pokowaka/oh-my-bash that referenced this issue Aug 28, 2020
The calculate of git_summary_status can be extremely expensive for large
repos. This results in the shell becoming unresponsive.

We now set a timeout of 0.2 seconds to make sure we always have
a responsive shell.

Fixes ohmybash#172
@pokowaka pokowaka linked a pull request Aug 28, 2020 that will close this issue
@ecnelises
Copy link

oh-my-zsh has a config item in git named oh-my-bash.hide-status. When this set to 1, shell prompt won't load git status. Can we add that?

@pokowaka
Copy link
Contributor Author

@chaifeng, @ nntoan, @rpotter12 is anyone interested in merging this pull request?

@nntoan nntoan added P3 - Normal Priority 3 - Normal P2 - Important Priority 2 and removed P3 - Normal Priority 3 - Normal labels Jul 9, 2021
@gdevenyi
Copy link

gdevenyi commented Jan 5, 2022

A slight adjustment to this, I'd like to be able to specify paths to exclude from git status, as some are mounted remotely and take a long time to run status.

@akinomyoga
Copy link
Contributor

I think this issue is actually a duplicate of #6. @gdevenyi Thank you for the suggestion! It seems there is a related solution in oh-my-zsh at ohmyzsh/ohmyzsh#3009 (comment). I think we may utilize the settings for oh-my-zsh.

Another solution is to use romkatv/gitstatus which extracts the git information in the background. akinomyoga/ble.sh also implements the background extraction of the git information. Or we may implement it by ourselves.

adithya2306 pushed a commit to adithya2306/oh-my-bash that referenced this issue Oct 3, 2022
The calculate of git_summary_status can be extremely expensive for large
repos. This results in the shell becoming unresponsive.

We now set a timeout of 0.2 seconds to make sure we always have
a responsive shell.

Fixes ohmybash#172
akinomyoga pushed a commit to pokowaka/oh-my-bash that referenced this issue Oct 14, 2023
The calculate of git_summary_status can be extremely expensive for large
repos. This results in the shell becoming unresponsive.

We now set a timeout of 0.2 seconds to make sure we always have
a responsive shell.

Fixes ohmybash#172
akinomyoga pushed a commit to pokowaka/oh-my-bash that referenced this issue Oct 14, 2023
The calculate of git_summary_status can be extremely expensive for
large repos. This results in the shell becoming unresponsive.

We now set a timeout of 0.2 seconds to make sure we always have a
responsive shell.

* lib/omb-prompt-base: Set a timeout on git commands
* lib/omb-prompt-base: Fix timeout bug
* lib/omb-prompt-base: Rename function "{run_with => _omb_prompt}_timeout"
* lib/omb-prompt-base(_omb_prompt_timeout): Fix coding style
* lib/omb-prompt-base(_omb_prompt_timeout): Check timeout commands on startup

Fixes ohmybash#172
Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants