Skip to content

Optimistically shallow clone submodules - #39

Merged
joshheinrichs-shopify merged 1 commit into
mainfrom
shallow-submodules
Oct 8, 2026
Merged

joshheinrichs-shopify merged 1 commit into
mainfrom
shallow-submodules

Conversation

@joshheinrichs-shopify

Copy link
Copy Markdown
Contributor

In chonky repos like grpc, full clones of submodules can take on the order of ~3 minutes. Shallow cloning should help though I haven't benchmarked this yet. In order to avoid changing observable behaviour, we fall back to a regular clone so if someone was shallow cloning a repo with submodules, and the submodule was coming from a forge that doesn't allow cloning of a specific sha, the existing cloning behaviour should be preserved.

Motivation

Context

@joshheinrichs-shopify

Copy link
Copy Markdown
Contributor Author

Clearing ~/.cache/nix between runs, this appears to drop eval time from ~5.5 mintues to ~3.5 minutes.

In chonky repos like grpc, full clones of submodules can take on the
order of ~3 minutes. Shallow cloning should help though I haven't
benchmarked this yet. In order to avoid changing observable behaviour,
we fall back to a regular clone so if someone was shallow cloning a repo
with submodules, and the submodule was coming from a forge that doesn't
allow cloning of a specific sha, the existing cloning behaviour should
be preserved.
@joshheinrichs-shopify
joshheinrichs-shopify marked this pull request as ready for review October 8, 2026 18:24
@joshheinrichs-shopify
joshheinrichs-shopify merged commit 17380d5 into main Oct 8, 2026
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants