-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Make a shallow clone of git submodules #24521
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see CONTRIBUTING.md for more information. |
I tried running
The current branch is rust-llvm-2015-02-19, but .gitmodules specifies the master branch instead. I'm using git version 1.9.1 on Xubuntu 14.04. Maybe that matters? |
@rprichard I think what you describe is consistent with @brson's findings when he investigated trying to do this, based on a recent conversation I heard him having. |
After research, this seems to be a common issue with submodules and low values of depth: |
I believe a bare |
As others have said, Rust submodules are not using the master branch of their repos, so a shallow clone of master will not work. The best way I can think to get to a point where this works would be to set all our submodules to a stable named branch and state that branch in .gitmodules, make it a policy matter that submodules always use that name. Getting there will require further planning, so closing this PR. |
If you want to pursue this further I might suggest opening up a thread on internals.rust-lang.org laying out a plan. |
Oh, the plan I stated previously doesn't work because historic checkouts don't work after submodule master branches have changed. |
When building from source, the build system makes a deep clone of LLVM and other dependencies, downloading several hundred megabytes, which takes a significant time over a slow connection. A shallow clone (done with
git submodule update --depth 1
, see http://stackoverflow.com/a/17692710/2754323 ) would only download the latest revision of the dependencies, since the rest of the commit history is not needed, and save bandwidth and space at no (as far as I know) cost.