Expand description
Build a code graph from a git revision (git-archive → tempdir → build),
without disturbing the working tree. Exposed as code_tree.build(rev=…).
Build a code graph from a git revision without disturbing the working tree.
git archive <rev> streams a tar of exactly the tracked files at that
revision — it never touches HEAD or the working tree, and it only emits
committed files, so untracked junk and .gitignored paths are absent for
free (a superset of .gitignore semantics). We extract that tar into a
tempfile::tempdir() and run the ordinary build pipeline
(crate::code_tree::builder::run_with_options) over it unchanged — zero
parser changes, zero walk changes. The existing manifest::walk_filter
still runs on the extracted tree, so any committed node_modules /
vendored build output is dropped on top.
Reuses the established git-shelling convention from repo.rs
(std::process::Command, list args, no shell).
Functions§
- archive_
and_ build - Build a code graph from
src_diras it existed at git revisionrev. - build_
code_ tree_ revs - Build one merged code graph spanning
revs(git revspecs — tags, SHAs,HEAD), oldest → newest in list order. - dedup_
revs - Collapse a requested rev-label list to its order-preserving unique form
(first occurrence wins). A duplicate label resolves to the same tree, so
re-folding it only inflates the per-entity
revs/rev_fplists and the provenance banner. Shared by the core builder and the MCP activation wrapper so both agree on the canonical label set.