shallow clones are bad?
shallow clones are bad?
Posted Aug 31, 2026 20:52 UTC (Mon) by mricon (subscriber, #59252)In reply to: shallow clones are bad? by jtaylor
Parent article: Ryabitsev: Creepy crawlies
They are bad on the server side. If someone's doing a regular clone of stable/linux.git, most of the pack is already prebuilt and we just send it down the pipe. Whatever loose objects are missing, it's only a few and we can quickly make a pack of of them.
Now, if someone is cloning with --shallow, this means we need to:
- figure out which objects those are out of several million (could be --depth 10, for all we know)
- compress them on the fly (that's gzipping 1G+ of stuff)
- keep it in RAM as we send it down the pipe until the client finishes
One or two shallow clones is no big deal, but if a CI system decides to spin up 20 nodes that all decide to do --depth 1, that's a problem.
