r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
331 stars 152 forks source link

Unadvertised SHAs don't work for github/bitbucket #675

Open muschellij2 opened 2 years ago

muschellij2 commented 2 years ago

Fixes #674. I know it's heavy handed in the sense that github/bitbucket git repos are going full depth, but otherwise you can't use SSH with install_git to specific SHAs.

The use case is using SSH keys (as opposed to GITHUB_PAT for a number of reasons) and you want to install specific references of packages for a reproducible environment. git fetch origin SHA won't work for these.

muschellij2 commented 2 years ago

Killing this PR - but may be good to have a warning if "like" a short SHA?

muschellij2 commented 2 years ago

This still does have an issue as the https://github.com/r-lib/remotes/blob/eb15a1eb21cca47ce5601747fd4e033d8606a648/R/install-git.R#L202 uses archive and this is an issue for bitbucket and github as well.

gaborcsardi commented 2 years ago

@muschellij2 I am sorry, I forgot, is this still an issue, or using the full sha solves your problems?

muschellij2 commented 2 years ago

I believe it does, but do you think this solution would save some users who put a short SHA? Or maybe put a short SHA check with GH or bitbucket?

On Wed, Feb 2, 2022 at 3:27 AM Gábor Csárdi @.***> wrote:

@muschellij2 https://github.com/muschellij2 I am sorry, I forgot, is this still an issue, or using the full sha solves your problems?

— Reply to this email directly, view it on GitHub https://github.com/r-lib/remotes/pull/675#issuecomment-1027693648, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGPLXBO3MN2KIO5M53MFLUZDTIZANCNFSM5JIEOZJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

-- Best, John

gaborcsardi commented 2 years ago

You are right that a full clone would save some users, but it would also cause pain to other users, when installing from large repos. Popular packages often have large repos, e.g. ggplot2, etc.

I think if the short sha is not found, then we could include a tip in the error message, suggesting a full sha.