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

Reduce data it downloads #122

Closed
Tranquility opened this issue Nov 21, 2014 · 7 comments
Closed

Reduce data it downloads #122

Tranquility opened this issue Nov 21, 2014 · 7 comments

Comments

@Tranquility
Copy link

You can use sparse checkouts (to download only the directory specified in "rtp") and shallow clone (to not download the full history) to drastically reduce the data it needs to download.

This is especially important with big repositories like rust. For exacmple:

 Plug 'rust-lang/rust', {'rtp': 'src/etc/vim'}
@junegunn
Copy link
Owner

I've heard about shallow clone, but not sparse checkout. So how do I do it? Could you give me an example command?

I haven't tried to add shallow option simply because most Vim plugins are small and there shouldn't be much benefit. The only exception I'm aware of is YCM, and it didn't feel right to add an option just for that single plugin.

For Rust, you really should check out this repository, I myself use this one:
https://github.com/wting/rust.vim

@Tranquility
Copy link
Author

Here is an example of using a sparse checkout:

git init rust-vim
cd rust-vim
git remote add origin https://github.com/rust-lang/rust.git
git config core.sparsecheckout true
echo "src/etc/vim/" >> .git/info/sparse-checkout
git pull origin master

And you are right that shallow does is not really needed but isn't it really simple to add? You just need to use --depth 1

@Tranquility
Copy link
Author

And you need to combine both methods because otherwise the .git directory still contains a lot of data. In this example it still contains 192M. But if you do a shallow clone and a sparse checkout at the same time the directory contains 7.6M.

You just need to pull like this: git pull origin master --depth 1 (after setting up the sparse checkout).

@vheon
Copy link
Contributor

vheon commented Nov 21, 2014

Be aware of the issues regarding shallow clone, look at this comments: gmarik/Vundle.vim#28

I have a question regarding the sparse checkout what would happen if I have a plug in like:

Plug 'user/plugin', { 'rtp': '/some/path/vim' }

and a script in this plugin depends on some other file in user/plugin like some binary?

@junegunn
Copy link
Owner

@Tranquility @vheon Thanks for the info. Unfortunately using sparse checkout seems more complex than I imagined, and like @vheon, I'm also worried about subtle compatibility issues on some plugins. So I think I'm leaning towards not supporting it, not as the default, and not even as an optional feature in the spirit of simplicity, considering that there are very few cases that this might actually make a difference. (As I mentioned in the previous comment, https://github.com/wting/rust.vim easily solves the issue for Rust.)

Shallow cloning option still sounds very tempting, but the issues shown in the link @vheon provided make me worry. I've read some comments but I still haven't figured out what exactly the problem is and what would be the solution if there's any.

@junegunn
Copy link
Owner

Closing by #218.

junegunn added a commit that referenced this issue Apr 28, 2015
@junegunn
Copy link
Owner

The patch was reverted. The discussion will continue on #217.

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

No branches or pull requests

3 participants