Skip to content

v3.1.0

Choose a tag to compare

@Lockyc Lockyc released this 18 Jul 09:24
· 29 commits to main since this release

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 fileSource seam 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. GraphSchemaVersion is unchanged (still
    1); on a clean tree, --ref HEAD produces output identical to the default run.
  • Correct-by-definition divergence. --ref reflects 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. Only graph is 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.