-
-
Notifications
You must be signed in to change notification settings - Fork 719
feat: shallow clone git repository sources (including auth changes) #3542
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
base: main
Are you sure you want to change the base?
Conversation
@wale is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
Thanks, @wale. repository: string | { url, branch } | { url, tag } Also it would be awesome if we can compare performance of old logic and new one |
I had initially figured it was out of scope, but that is a good idea, the change would make it much more cohesive.
That's a good idea, although wouldn't it be more sensible to keep both the previous logic (i.e. downloading a tarball from provider) and this PR? In case one doesn't work, the other might make more sense to use; preferably as Github and Bitbucket specific sources. |
I'd keep only one solution if it's generic enough, So if new solution works for Github and Bitbucket lets use it. But we can provide a compatibility solution and deprecate old usage before removing them all. As an alternative, I was thinking about using giget package to download repositories. We need to check about the coverage and performance of giget and |
That's true, I'll keep my generic solution, and hide the previous logic behind a boolean (
Personally I think |
π Linked issue
Reopens and closes #3338, continues #3531
β Type of change
π Description
Creates the option of shallow cloning (
--depth=1 --single-branch
) a Git repository, by enabling a boolean optioncloneRepository
.This change also adds support for cloning repositories with Git refs (tags and branches only), with another option in the source definition; alongside support for usernames with authentication tokens, as an attempt to support Forgejo-based (and other odd) providers.
The change was required as I use a non-Github/BitBucket repository for external Markdown files, and the current solution of submodules +
git-sparse-checkout
was no longer tenable.The Git source also stores
.content.cache.json
differently to Github/Bitbucket sources, like so:where the Git commit hash is referencing
git ls-remote
.Uses
isomorphic-git
to avoid shelling out to thegit
CLI. Needs testing onbun
environments.π Checklist