-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
add option to only use HEAD version of git when installing #217
Comments
Duplicate of #112? |
Yep shallow clone and sparse checkout were suggested in #122. I still don't see the point of sparse checkout, but now I think shallow clone can be a good addition to vim-plug. I was reluctant at first because of some issue reports, for example this one: Shougo/neobundle.vim#81 (comment). But it looks like the problem is in |
@junegunn So the proposal is make clone command use |
I have no hard evidence on this, but have had no issue with it and don't see how it could go wrong.
That's a good point. Plugin developers will notice the change. But I don't want to bother the majority of the users with another option. Hmm. Another issue is that |
That was exactly what I was thinking.
Could we bother the minority of users who writes their own plugin with an option?? |
Good point. We probably should add a switch if we're really going to do this. |
@junegunn The problem with YCM is it also has a loads of submodules. Even if this gets pushed, those still take time. I noticed some even get cloned twice because some are dependencies of YCM & the separate ycmd server.The test @marcmo ran didn't use Regarding implementation of this, I'm in favour of an option. Perhaps: function! s:clone_opt()
return get(g:, 'plug_unshallow', 0) ? '' : '--depth 1'
\ . s:git_version_requirement(1, 7, 10) ? ' --no-single-branch' : ''
endfunction |
@starcraftman so the |
@starcraftman @vheon
An option for global shallowness requires less changes in code and is simpler to use, so I like the approach, but yeah, in the end we probably should make it per-plugin configurable. But one may argue that for completeness' sake we need both global and local options. |
Yes, but after:
I don't see the real value of the feature itself. |
@junegunn I think there are a few things to clarify here.
|
@starcraftman Thanks for the write-up. The result is not radically different from what I'd imagined. My point was that YCM still takes too long even with the patch. As it takes longer than 2 minutes (it took much longer for me yesterday), users will "multi-task" in other tmux window or something instead of staring into the installation screen until completion. And YCM aside, it's arguable if the 15-second reduction only during initial installation really compensates the cognitive overhead by a new, insignificant option we probably have to add.
Yeah, I also noticed that while test-installing YCM. Can it be a bug of git? It's sad that we'd need an extra check of Having said that, I'm still tempted to make shallow-cloning default, as every user will benefit from it to some degree. What I'd like to avoid is to add global/local pair of There are a number of options:
EDIT: 8. Leave it as it is. |
My vote is 3 :) |
I would like option 5 but I don't want to pay the cost of parsing yet another option for every plug on startup for a feature only useful for Installation. So considering that
How is that possible?? I mean doesn't git produce some output when downloading the submodule?? |
Yeah, but it did happen to me from time to time. Maybe GitHub (or my internet connection) was extremely slow at the time. I'm running |
Yeah, I get that too. 😭 |
I wonder if they're interested in improving the installation experience of YCM. A compact fork of the project which downloads prebuilt binaries via CDN. |
FYI: I'm still cloning YCM. This is absurd. |
I don't know, seems a bit odd from a user POV. Perhaps the git guys intended it like that for backwards compatibility since older versions did complete clones of submodules. I might go look on their tracker to verify.
Perhaps, so something like Valloric/YCMPrebuilt & maybe the branches represent your build like Regarding vote, I'm for 3. In my opinion, most users will only ever want this on, unless they are doing some debugging. We should note this change at top of readme, maybe under 'pros' so that users see the change go in effect.
Clearly evil. 😈 |
@junegunn Was reading up on submodules from that link and noticed something. Doesn't seem like you can do depth=1 on a repo & its submodules, unless I got the command wrong. I believe the problem has to do with way submodules refer to git history tree. Example not working (no --recursive). What I had on my fork. Due to So we can put depth=1 for all top repos, but not submodules. Might be a git limitation? YCM probably should stop using submodules at this point, just going to continue making install longer & longer due to ever increasing history of all projects involved. You might want to further test/research this to confirm, but that's what I understand. |
And how would you handle those required libraries? |
@vheon Probably something along the lines of the prebuilt thing @junegunn suggested. To note, just the ycmd submodule has itself 9 submodules that take time. All just to build ycmd server. If there were some command like :YcmdUpgrade that pinged a cached build server that would considerably save space/time. |
@starcraftman Thanks for the investigation. Hmm, I'll also take a look at it. @vheon YCM already has the install script, so I can imagine it shallow-cloning the prerequisites instead of depending on git submodules, though it may not be as elegant. |
So with:
What you're saying is that: for speedup installation time YCM should look at other approaches instead of cloning the project like it does now. At first I thought that you were saying to stop using submodule altogether.
That actually IMHO is not in the scope of YouCompleteMe which is merely a client for ycmd. |
@vheon At the end of the day ycmd (and submodules) download & build is the longest bit. I'm sure somehow it could be cached & retrieved, but that'd involve work Valloric probably isn't interested in at this point. Maybe something for a fork to do/manage. Until then, only thing we can do to go faster is depth 1, but YCM will continue to be slow as molasses installing/building. |
Merged the PR. Now vim-plug will do shallow clone by default. |
Hmm, no. I realized that shallow clone cannot include tags so
|
@junegunn first of all thanks for paying attention to this issue! I still think it can be very valuable since setup times and download sizes might be an issue for someone (like me) about the |
Merged #221. |
Maybe this should also do shallow clones/updates for the submodules? It doesn't appear to do so at present. |
@elyscape I investigated that with YCM, didn't seem so easy. See my post under 'clearly evil'. If I got something wrong I'm open to correction or better info. Ultimately, seems to me submodules aren't meant for small footprint download due to way they worked, else I imagine git devs would have simply propagated depth 1 to them. |
Ahh, whoops. Missed that somehow. |
An additional pro of shallow submodule clones is that it would avoid fetching |
@junegunn for me, |
@ZSaberLv0 Feel free to fork the repo and use your own version. vim-plug has been very stable, and you probably don't have to worry about future changes. |
vim-plug is really fast when you update your plugins. but what can take a rather long time to do a fresh install (some plugins have a rather long git history).
but actually I'm not interested in the history.
e.g. I just installed YCM which is a rather huge repo:
Updated. Elapsed time: 170.097284 sec.
[============================================]
...
191M ./YouCompleteMe
if I just clone the HEAD version it with git:
compare that to the full repo:
The text was updated successfully, but these errors were encountered: