🔀 The File History That Stops Partway Back
A partial clone made with –filter=blob:none or –filter=blob:limit=<size> deliberately skips downloading most file content upfront to make cloning a large repository fast, fetching individual blobs lazily on demand as they’re actually needed – but git log on an older file, or a diff against a commit from before the clone’s own fetch depth, can need a blob that was deliberately filtered out and was never lazily fetched because the specific command being run didn’t trigger an automatic fetch for it, leaving history that looks like it simply stops, with no explicit error pointing at the real cause.
🔎 The Problem
git clone --filter=blob:none --no-checkout <url> big-repo cd big-repo git checkout main git log --follow -- src/legacy/old-module.js # Shows recent commits fine, then abruptly produces no further # output or a vague "fatal: unable to read blob object" partway # back in history, instead of continuing to the file's actual # origin What's actually happening: --filter=blob:none intentionally skips downloading blob content during the initial clone, fetching each blob lazily only when a command that needs its actual CONTENT asks for it (checkout, diff, show). Some history-walking operations instead reference blob object IDs purely for comparison or traversal purposes without triggering that lazy content fetch for every single one encountered - and if the remote's reachability rules or an interrupted connection ever leave one of those blobs genuinely unfetchable, the walk simply stops at that point with an error that names a missing object, not an obviously filter-related cause.
✅ Fix: Fetch the Missing Blobs Explicitly, Don’t Fight the Filter
- Run git log with –no-walk=unsorted combined with explicit object IDs, or simpler, just run git fetch –filter=blob:none origin <specific old commit SHA> first to force the missing objects to actually be fetched, before retrying the git log –follow command that failed on them the first time.
- For a specific file whose full history matters enough to look at repeatedly, use git backfill (in newer Git versions) or a manual git rev-list | xargs git cat-file to proactively hydrate every blob the file has ever had, rather than relying on each individual Git command to lazily fetch exactly what it happens to need on demand.
- If full deep-history access for a subset of files is a frequent, ongoing need rather than a one-off lookup, reconsider –filter=blob:limit=<size> (which still fetches every blob under the given size eagerly) over –filter=blob:none for that repository, trading away some of the clone-speed benefit specifically for files that are small enough that filtering them was never saving much anyway.
🚨 Why This Is Dangerous
- The error that surfaces (a generic ‘missing blob’ or an abrupt silent stop) gives no indication the real cause is the clone’s own filter settings from however long ago the repository was originally cloned – a developer debugging this reasonably assumes repository corruption or a network problem, not a configuration choice made once at clone time and since forgotten.
- This specifically tends to surface for whoever is the first person on a team to go looking at genuinely old history – most day-to-day work only ever touches recent commits the partial clone already has cached locally, so the gap in older blob availability can go completely unnoticed for a long time after the partial clone was first set up.
A partial clone didn’t skip your repository’s history – it only ever promised to fetch it lazily, and the moment a command asks for an old blob in a way that lazy fetch doesn’t anticipate, the history that’s actually still there looks exactly like history that was never kept.
