Skip to content

v0.13.2

Choose a tag to compare

@clemlesne clemlesne released this 28 Jun 16:34

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.lock build, .lock publish). Readers hold a shared lock across glob+open — never blocked by a build, never see a torn shard set. A .swapping marker 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_exceeded marker (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); reworked lock.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. Removed gitRepoStateInScope and 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.