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

Blinks theme hangs on large Git repositories #3723

Closed
slhck opened this issue Mar 26, 2015 · 8 comments
Closed

Blinks theme hangs on large Git repositories #3723

slhck opened this issue Mar 26, 2015 · 8 comments

Comments

@slhck
Copy link

slhck commented Mar 26, 2015

I have oh-my-zsh from Mar. 20th (latest) and use the Blinks theme.

I'm working in a semi-large repository (thousands of files), and as soon as I cd into that repo, the shell hangs. I cannot ctrl-z it, but I have to restart.

Changing to the default (no) theme fixes it for me. In other (smaller) repositories, it works fine.

Reproduced with:

  • Git version 2.1.4 on Windows (Cygwin)
  • Git 1.9.1 on Linux Mint
  • Git 2.3.4 on Linux Mint
@slhck slhck changed the title Blinks theme hangs on large repositories Blinks theme hangs on large Git repositories Mar 26, 2015
@apjanke
Copy link
Contributor

apjanke commented Mar 26, 2015

This is probably just that git status can be slow for large repositories, and the prompt for the Blinks theme includes git status output. To verify this, switch to a non-git-displaying theme like cypher or no theme, and do a time git status inside that repo.

As a workaround, you can set the git config oh-my-zsh.hide-status 1 option in that repo, as mcornella suggests in #3706. This will disable the git status check in that repo specifically for all themes that use it.

@slhck
Copy link
Author

slhck commented Mar 26, 2015

Works nicely, thanks!

Should we still keep this open? I don't know if there's a sensible way to make the function time out if it takes too long... or any alternative solution.

@apjanke
Copy link
Contributor

apjanke commented Mar 26, 2015

Nah, just close it. There's an existing issue #3009 for the general "git status is slow" problem.

It would be possible to add a timeout, but that would probably require writing an asynchronous git wrapper that uses the git program in a client-server mode (and is portable to Windows). Might be possible with zsh's coprocess support, but would require some work. Could be worth it though; this is a periodic problem.

@slhck
Copy link
Author

slhck commented Mar 26, 2015

Closed as dupe of #3009

Thanks, Andrew.

@slhck slhck closed this as completed Mar 26, 2015
@apjanke
Copy link
Contributor

apjanke commented Mar 26, 2015

Hey, is this a public repo that I could use as a test case for doing a git status timeout? Or do you know of another really big one that is slow?

@slhck
Copy link
Author

slhck commented Mar 26, 2015

The only thing that comes to mind is the Linux kernel, but I don't know if it's that slow to work with. It probably has lots of small files rather than large files (which is where Git's performance decreases).

(I cannot share the original repo, sorry…)

@apjanke
Copy link
Contributor

apjanke commented Mar 26, 2015

I'll just stick it behind an NFS share; that's sure to be slow enough. :) Thanks!

@apjanke
Copy link
Contributor

apjanke commented Mar 26, 2015

HA! The coproc/read -p -t seems to work: #3725.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants