v3.1.0
graph --ref <ref> — read the doc-graph at a git ref (bare-repo capable)
docgraph graph reads the working tree by default. The new --ref <ref> flag
(e.g. --ref HEAD, --ref dev) builds the graph from the committed state at
that ref, read entirely from the git object store — so graph now runs inside
a bare repo, with no checkout. This is the mode a scanner (e.g. Mycelium
reading a bare repo store) uses to capture a repo's doc-graph without
materializing a work-tree.
- Same output, one computation. A
fileSourceseam backs the graph builders
with two sources — the working tree (git ls-files+os.ReadFile) and a git
ref (git ls-tree+git show). Both feed the same graph computation, so the
served graph can never diverge by mode.GraphSchemaVersionis unchanged (still
1); on a clean tree,--ref HEADproduces output identical to the default run. - Correct-by-definition divergence.
--refreflects committed state only, so
it ignores uncommitted or untracked edits to tracked docs — which is what
reading "at a ref" means, and what a bare-store scanner wants. - Working-tree behavior unchanged. With no
--ref, every path behaves exactly
as before. Onlygraphis ref-aware; the pre-push audit checks stay
working-tree only.
No breaking changes — additive flag, unchanged payload shape. Consumers on
@latest pick it up transparently.