Repository navigation
fix: fetch only the selected subtree with a treeless partial clone - #27
Conversation
Use a blobless partial clone (--filter=blob:none) for the bare repository cache and an anchored, literal non-cone sparse pattern for subtree snapshots and write worktrees, so only the selected subtree's file contents are downloaded and materialized. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The blobless cache still downloaded every commit's full directory structure (12 MB for a repository whose docs subtree is 1 MB). A treeless clone stores commits only and downloads trees and contents when a snapshot or write worktree checks them out. Covers commit, publish, and rejected-push recovery through a treeless cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yuezengwu
left a comment
There was a problem hiding this comment.
The treeless-cache and literal sparse-checkout behavior passed the full118-test suite, typecheck and repository check. One reproducible test-isolation defect remains: the object-presence assertions perform implicit external promisor fetches instead of staying local. Details are inline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yuezengwu
left a comment
There was a problem hiding this comment.
Re-reviewed f89dc02 against current main2e4be21f. The object-presence probe now disables lazy fetching and has a local-only fallback origin. Independent Git tracing found zero fetch children across all four presence probes with HTTPS prohibited.
The full118-test suite, typecheck and repository check passed. The prior test-isolation finding is resolved; no remaining code defect found in the treeless cache, literal sparse checkout or write/publish behavior.
Part of #29.
Summary
Managed Git sources downloaded far more than the selected tree:
git clone --bare. Forfirst-tree-ai/opentag(tree atdocs) this is 76 MB and 51 s.This change:
--filter=tree:0). It stores commits only; directory trees and file contents are downloaded when a snapshot or write worktree checks them out. Later fetches inherit the filter viaremote.origin.partialclonefilter./<subtree>/) for snapshots and write worktrees, so only the selected subtree is materialized. Commits and publishing keep a full index and preserve outside paths.WRITE_OUTDATED, session preserved), and a fresh retry all work through a treeless cache.docs/specification.md.Measurements (real
first-tree-ai/opentag,docs, one Local Computer)blob:nonetree:0With a warm treeless cache: a fetch is about 1.2 s per repository; checking out a new commit of
docsis about 3 s.Validation
pnpm check,pnpm typecheck,pnpm test(118 tests),pnpm check:packagepass.Trade-offs
sync --offlinenever fetches refs, but creating a snapshot whose trees or contents are not cached needs the remote.🤖 Generated with Claude Code