v0.13.2
Indexing no longer blocks searches, and scoped Git searches reuse the whole-repo index instead of building one per scope.
No flag changes. First search after upgrade may rebuild the index once; later searches reuse it.
What changed
- Lock-free builds. Builds run in a temp dir, validate HEAD, then publish atomically under a brief lock (
.build.lockbuild,.lockpublish). Readers hold a shared lock across glob+open — never blocked by a build, never see a torn shard set. A.swappingmarker recovers a crash mid-swap. - Scopes share one index. A scoped search (
seek 'x' ./cmd/seek) reuses the combined whole-repo index and filters at search time — no per-scope layers, less rebuild churn. - Over-cap fallback. If the whole repo exceeds index caps, a scoped search builds a per-scope index instead, so large siblings can't cap small scopes. A
.git_cap_exceededmarker (HEAD + cap limits) caches the verdict; HEAD or cap-limit change re-evaluates. - Faster file scopes. ≤64 file operands compile to trigram-assisted anchored regexps instead of an O(docs) scan; above 64 falls back to set lookup.
- GC hardening. Sweeps orphaned temp build dirs, skips eviction during a build, excludes temp dirs from reported size.
Dev/test
- New
swap.go(temp build, atomic publish, crash recovery); reworkedlock.go(acquireBuildLock/acquirePublishLock/acquireReadLock). - Scoped path collapsed onto the shared index in
corpus.go/git_scope.go/main.go; per-scope index kept only as the over-cap fallback. RemovedgitRepoStateInScopeand the committed/dirty/shared-committed layers. - Coverage: build/search concurrency, mid-swap recovery, orphan-dir GC, shared-index reuse, over-cap fallback, file-operand regexp vs set.