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

Download only subdirectory for GitHub packages when appropriate #704

Open
jashapiro opened this issue Oct 10, 2024 · 3 comments
Open

Download only subdirectory for GitHub packages when appropriate #704

jashapiro opened this issue Oct 10, 2024 · 3 comments

Comments

@jashapiro
Copy link

When installing a package from GitHub where the package is in a subdirectory of the main repository, pak::pkg_install() downloads the entire repository. For some repositories this may be a non-issue, but if the repository is large (and the R package is only a small part of the repository), this may result in a long, slow download.

Might it be possible to implement a sparse-checkout or equivalent to reduce downloads and improve install times in this situation?

@gaborcsardi
Copy link
Member

Try a git:: remote, that possibly already does a sparse checkout.

It is hard to do a sparse checkout for github:: because there is no good way in the GH API to do that.

@jashapiro
Copy link
Author

It does not seem that the git:: remotes in pak allow subdirectories? I did test whether remotes::install_git with a subdirectory specified used a sparse checkout, but it does not seem to.

@jashapiro
Copy link
Author

Or rather, maybe a sparse checkout isn't quite what I want, as that seems to still download the whole .git folder, which can be large.

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

2 participants