-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Optional use of shallow clone for git repos #1888
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
Comments
This would definitely be worth looking into, this might be able to take a chunk of storage. I haven't looked into this at all, be the |
Looks like we can now support this with the |
If someone could test that this is possible, it would be a pretty sizable win in terms of disk space needed. |
What exactly do you mean by update the list of branches? If it is simple obtaining a list of all branches and tags, then it can be done using git ls-remote --heads --tags https://github.com/rtfd/readthedocs.org.git You don't even need to clone repository to do so. See https://www.kernel.org/pub/software/scm/git/docs/git-ls-remote.html |
travis uses --depth=50 |
We have the depth option in the fetch command too https://git-scm.com/docs/git-fetch/2.17.0#git-fetch---depthltdepthgt, I'm testing it, looks like is something that could work for every project. Any reason to not do that on every project? Also, depth=1 looks fine. |
Do we still get branch/tag info with a shallow clone? |
Yeah, we do, actually I just have a POC for this. So, we could add a feature flag to test and force everyone to do a shallow clone, or make it an option for the users. The only thing I can see is where a custom extension needs info from other commits I guess? |
It would be great if there was an option to enable shallow clone for repositories. If set, then RtD should use shallow clone (
--depth 1
option ofgit clone
) instead of full clone if possible.This will result in huge disk space saving for projects with large history.
E.g., for one of our projects
/www/readthedocs.org/user_builds/{project}/checkouts/latest
folder takes up to 400 Mb, when cloned with--depth 1
, it takes up only 12 Mb.The text was updated successfully, but these errors were encountered: