-
-
Notifications
You must be signed in to change notification settings - Fork 682
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
lib/omb-prompt-base: Set a timeout on git commands #173
base: master
Are you sure you want to change the base?
Conversation
rebased. |
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 <[email protected]>
Added fixes and squashed. |
@pokowaka @HanJoHibender Do you have any thoughts on this? I now think the default timeout 0.2 sec might be too short. If the timeout is too short, the prompt information will not be shown in many repositories. In fact, a user who picked this commit has increased the timeout to 1 sec: @ghostrider-reborn Maybe you also have a comment? But still, there might be cases where Git information is wanted even if it takes time to show the prompt. Another approach is to get the Git information asynchronously as I mentioned in #172 (comment). |
As suggested in #6, another approach is to allow the user to disable the git prompt information for each repository. |
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 #172