Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vpm: fix regression, so `v install sdl && v run ~/.vmodules/sdl/setup…
….vsh` works again
- Loading branch information
27cc277
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this fix not be made on sdl or the commands side?
When sdls setup script requires a repo with deeper depth, then why not unshallowing it prior to running the script or - if it's possible -inside the script before trying to get branch information?
The cost seems too much in terms of performance and bandwidth.
27cc277
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That requires, the authors of modules to know about not just their own repo's setup, but also more details about what vpm does (which is subject to change and evolution), and whether it was used or not (compared to just
git clone some_repo_url
).I would prefer, if that is not required of them.
v install
should automate module installation for users, and decrease the amount of efforts required by authors, in the first place, not make it harder, and less predictable.The optimization, done by
--depth=1
is nice to have, but should not be the default.27cc277
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cost for most repos will be minimal.
It will be bigger for repos with thousands of commits, but those are rare, and even in those cases, it is seconds.
I do not have very fast internet connection to github (~2-3MB/s currently), and yet:
Note, that the V repo, currently has 17479 commits at the moment.
Note also that github do not recommend
--depth=1
(shallow clones) for anything, butbuild environments where the repository will be deleted after a single build.
https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ .A module/package repo, that can be updated (fast forwarded), or that can switch branches (like vlang/sdl's setup.vsh script does), will benefit more from a clone that is not shallow, and has the metadata for all commits, even if some of the blobs are not there initially).
27cc277
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note also that
--filter=blob:none
(which is still kept), offers a compromise between developer convenience, and used network and disk resources:27cc277
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are the results for vlang/sdl, which does not have as many commits, and is still bigger than most (because of its history, and its many branches):
27cc277
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, the
--filter=blog:none
allows to preserve most benefits.E.g. cloning v-analyzer(no submodules) [shallow clone: 14MB, filtered clone: 14,6MB, regular clone: 53.7MB].
v-analyzer stores some generated code, and for me, it was just the case that I had some negative experiences with projects that kept lots of generated code in the repository, along with regularly updated thirdparty and assets and binaries. The full history was huge there.
Thanks for the response 👍