vcprompt slow on large repos
Closed this issue · 5 comments
Notable test case: https://github.com/mozilla/mozilla-central
This has been mentioned before other places, but I wonder if there is any way for vcprompt to auto-detect when it's "taking too long". I would rather not have to try to modify my ps1
depending on the directory.
1589 glind ~/gits/mozilla-central [git:master?] $ time vcprompt
[git:master?]
real 0m3.476s
user 0m0.421s
sys 0m1.610s
1590 glind ~/gits/mozilla-central [git:master?] $ time git status
real 0m6.032s
user 0m0.556s
sys 0m1.389s
For solutions, maybe wrap subprocess call with a timeout, as in one of these solutions:
http://stackoverflow.com/questions/1191374/subprocess-with-timeout
This is my... not sure if solution or workaround, for this problem:
Added a crude version in 6625c7b.
-t
, --timeout
or VCPROMPT_TIMEOUT
can be used to set the timeout, which must be an integer. The default is 0 (no timeout). If the timeout is reached, vcprompt
will exit with status 126 and no output.
I do like the idea behind @lkraav's solution. I'll see if I can come up with something that doesn't involve littering the file system with extra files (and extra stuff in a project's .gitignore
).
Yeah, litter is a concern. I don't much dig any lag in my systems, either. But it's one or the other, pick your poison.