-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: Support for shallow clones #28
Comments
I'd just like to add a +1 from me. . I actually think this would probably even be a sane default. You could most likely use the same mechinism as the custom naming uses now to override this option. |
I think this does the trick. Note that since all the repositories in vim-scripts have a tag for every commit, this change has no effect for them. I was unable to find a way to not clone the commits which have a tag associated with them. |
I think having a simple switch as configuration is a simpler approach that would cover practically all cases. I can't imagine why someone would want any depth other than 1 or the full thing, so I'd suggest something like |
@rson, I probably did not explain what I meant correctly, what I meant is to basically keep the same logic @0 has put in place, only change the control variable name and meaning, from This being a global setting doesn't mean that it cannot be overridden on a per plugin basis, with something like |
@jdevera, I feel that in your case, you lose generality with no loss of complexity. With my version, you can specify a global or local depth of 1 to do the shallowest clone, or of 0 to do the deepest clone. Or if for some reason you so fancy (but only if you do), any other depth value to your liking. With your version, you could do the first part (in the exact same manner, but with different names), but not the second. That said, it's ultimately up to @gmarik, so for the time being I won't make any changes to the code I pushed. |
wow, what's going on here.... ) There are not many options, which makes Vundle simple, which is important, IMHO But the part with using global variables/naming is kinda important: what if instead using global variables we'd just pass options:
What do u say? |
Well, I don't really mind as long as it works :), I guess that kind of nested structure looks more awkward than a global variable, which is a very common method of configuring plugins in vim. However, I am guessing that because vundle has to be called at the beginning of vimrc, it already is a special case and thus the special type of tuning method makes sense. But really, at the end of the day, what matters is that it works, I don't think a lot of people will use this feature, and those of us who would use it probably don't mind either way. |
yeah, i agree, hashes aren't as readable as global variables... |
Your second option ( |
@gmarik, is there anything you disagree with in my pull request other than the naming? |
@0 if your question is why pull request haven't been merged then the answer is that ppl had lots of issues with current features/documentation. Which is a sign that Vundle needs better test suite before adding new features. So it's kind of "feature freeze" for now. Let me know what you think... |
I don't really have an opinion on how this should be configured, but IMO a clone depth of 1 should be default. The vast majority of the time people are going to be installing bundles as plug-and-play, saving space and time with shallow clones is a no-brainer. If you want to hack on a particular plugin and contribute upstream and/or push customizations to your own fork, it's trivial to convert a shallow clone to a full one on an as-needed basis. |
That's true, but there's another side: But don't they conflict with each other? |
@gmarik, the shallowest possible clone gets all branch tips, all the tagged commits, and all their parents, so it would still always be possible to refer to named (branch/tag) commits that way. Referring to an individual commit by its hash would obviously not work if that commit doesn't exist, but I think this is reasonable for the general case. On the other hand, if you're going through the trouble of specifying a commit hash, you can also disable shallow cloning. |
@gmarik, you're confusing me, 'v': will work for tags as well as revisions? I see what you mean though. I mean, you could make 'v' disable shallow but that only works if 'v' is specced on clone ... ... if one specced a hash on a shallow clone you'd have to trash the repo and re-clone, or error-out descriptively. On the other hand, it makes it easier to make an 'I want only tagged revisions' update mode, shallow-clone, checkout the latest tag, and check for a newer tag on pull. That would be handy, since understandably some people don't push every minor version to vim.org |
@Taverius yes, 'v' should work for both @0, cool, didn't know that! The use-case i'm thinking of looks like this:
Now how this situation should be dealt with? IMO above looks like a lot of state-management for Vundle, will make code way more complicated... |
It's been a while since I opened this feature request and during this time I've been cloning the full repositories for all my increasing number of plugins. To be honest, I think I should not have opened this issue. I said:
I no longer believe that the word significantly is well suited here. Git compresses its repositories really well and also most of the plugins we are going to be getting with Vundle come from the vim-scripts user, which only creates one commit per uploaded version in the official site. So most of the time there won't be many revisions and most of the time, the size is going to be really small (just a couple of text files). I believe Vundle should be kept simple and that being able to specify a commit/tag/branch is far more useful as a feature than having shallow clones. If having both means it's too easy to screw up the config or that Vundle needs to start checking a thousand conditions and having nice bailouts for all, I'd say drop the depth feature instead. |
@jdevera good points. |
(I thought I posted this comment, but seems like I cannot find it anymore, so reposting again): Unrelated to this issue:
Let me know what you think. |
I tried it, but I get errors (I assume a red exclamation mark means an error) and could not see what the real problem was. Seems like error messages are swallowed by vim. Is there any way to see error messages? |
yes, red exclamation mark means errors. |
I've created a new issue (#69) to track it. All details there. |
@jdevera - thanks for the report! |
@jdevera @gmarik Sorry for digging out this issue, but after reading the discussion above, I still think this feature is necessary. Today I installed rust support via Vundle from Mozilla's official GitHub repo by adding the following line to my .vimrc:
There was a long time before it finished downloading, because it downloaded the whole rust repo with all its submodules, which occupied nearly 500MB in all. After I removed the llvm submodule manually, which was 187MB, total size of the repo became 314MB whereas the .git directory itself wastes 292MB, more than 10x larger than the code of rust, and over 10,000x larger than the vim plugin I need actually which is only 20KB or so. I know that most vim plugins are in their own repoes, which are not so large. But there are some exceptions like this case, indeed. Anyway, I don't think downloading and storing such huge useless data is a good idea, so this feature is still desirable. |
@upsuper It's fine, the issue is still open anyway. I'd still like to see this happening in Vundle, although I never thought of the rpt parameter case where the overall repo is huge. What I mean is, that we'll eventually get there. I think for this particular case maybe having a shallow clone would perhaps not save you enough space/bandwidth. I had a similar issue once where vim support was part of the product and ended up creating a separate repo for the vim files. Alternative, you can ask the maintainer to provide the vim support files as a separate repo, so everyone wins. |
👍 This would save a lot of people a lot of time. To quote @gmarik himself: "Vundle is slooooow please fix it" 😜 |
No. Vundle should not support shallow clones. See this issue problem. |
@Shougo I don't understand the assertion that it does not save time. It absolutely does. But clearly it's not a viable solution if it's going to break with a significant number of plugins. Vundle is just going to be throttled by git. 😢 That's OK. Certainly not a huge deal. ❤️ Vundle! Thanks @Shougo and @MarcWeber for the additional information. I appreciate it. |
Perhaps we could, as @gmarik suggested years ago, configure this per Bundle. So you can configure it only on bundles that can handle it. |
@jdevera 👍 |
OK. I think it is better solution. |
VAM has been supporting shallow clones for a long time without issues. |
I'd like to chime in that for some of us time isn't the issue, but space. I sometimes have to ssh in to a computer at school to submit assignments, and my disk quota is 15MB. I can not install all my normal plugins :( |
Vundle should support shallow clone per plugin basis For example, if i install docker syntax with setting |
Such a nice feature but it seems sadly developer aren't going to add this :( |
It seems docker project's problem. |
This is a feature request.
It'd would be convenient to have a user settable global variable that controlled whether the git clone command that is execute to download plugins makes a full clone or the original repo or a shallow copy.
Ideally, this shallow copy would include only the latest revision (
--depth 1
)It would be even nicer if whatever the global setting is, it could be overridden on a per bundle basis.
Shallow clones can speed up download time significantly if there are many plugins installed, specially when repos have many revisions.
The text was updated successfully, but these errors were encountered: