Fisher: Do not copy plugin's repo from cache ↔ config, use tar instead

Created on 25 May 2016  Â·  7Comments  Â·  Source: jorgebucaran/fisher

Using tar is a very fast way to copy stuff and we can easily exclude stuff like the .git directory when moving things to the config.

tar -c --exclude .git . | tar -xC $fisher_config

Most helpful comment

no idea:(
it looks like okay. there are some ideas to copy files and exclude other files how-to-use-cp-command-to-exclude-a-specific-directory

All 7 comments

@fisherman/all Thoughts?

no idea:(
it looks like okay. there are some ideas to copy files and exclude other files how-to-use-cp-command-to-exclude-a-specific-directory

I think the underlying idea, i.e. not copying the entirety of the git repo from the cache, is good; however, I have my doubts about (mis)using tar just to do that (besides the costly but pointless “pack archive then unpack it immediately again” step, I would be worried about things like permissions, xattr, symlinks et al.). find and rsync would seem better options.

Should run a benchmark, tar vs cp and when it makes sense. Since a lot of plugins are likely small the overhead of creating the archive, moving it and then unpacking it might not be worth it over a simple copy. Especially since this is on the local system.

You could also hardlink instead of copy things, then it would also not take up additional space (though honestly in this case that's a rather silly optimisation).

I tried looking at rsync docs and examples, but couldn't figure out the correct incantations to make it work, and tar was quite fast despite the involved overhead.

Whatever we go with is fine, though. The thing here is: how to exclude the .git repo when copying the plugin's directory from the cache into the config?

@brj I should have written “find or rsync”. The Stack Overflow question @detailyang linked to has some good hints in that direction.

rsync is a mess. please dont

On 25.05.2016, at 18:58, Martin Kopischke [email protected] wrote:

@brj I should have written “find or rsync”. The Stack Overflow question @detailyang linked to has a some good hints in that direction.

—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly or view it on GitHub

Was this page helpful?
0 / 5 - 0 ratings