Expand description
mushroomdb ingest-git <db> <repo>: build and maintain a graph of a git
repository. First run ingests the whole history; later runs apply only the
commits after the recorded GitSync head, so deletes and renames retract
or move derived edges instead of leaving them stale.
Graph shape:
| Label | key (id) | props |
|---|---|---|
Author | mailmap-resolved email | name, name_counts |
Commit | full sha | message, ts, author_id, pr_id (with --prs) |
File | path | path, dir, ext, commits, n_commits, top_author_id, author_counts, plus the working-tree props in structure |
Symbol | "<path>#<qualified name>" | see structure |
PR | "pr:<number>" | number, title, url, merged_at, author_login |
GitSync | "__mushroomdb_git_sync__" | sha, synced_at, repo, recurse, prs, structure, docs |
Edges: user TOUCHED Commit→File and MERGED_AS PR→Commit, auto-FK
AUTHOR Commit→Author, TOP_AUTHOR File→Author and PR Commit→PR,
rule-derived CO_CHANGED File→File and KNOWS Author→File — and, from the
working-tree pass, DEFINES, IMPORTS, CALLS and MENTIONS.
With --recurse-submodules each initialised submodule is walked as its own
unit: its file keys carry the submodule’s path in the parent, and it
resumes from its own GitSync marker.
Structs§
- Ingest
GitOpts - Ingest
GitReport - Sync
Report - What one
run_syncdid.
Constants§
- BUSY_
MESSAGE - What the CLI prints, and exits 3 on, when another process holds the store’s cross-process write lock. Nothing was written, so retrying is always safe.
- DEFAULT_
EXCLUDES - Applied when the user names no
--excludepattern of their own. - DEFAULT_
MAX_ COMMITS_ PER_ FILE - Cap on the
commitslist stored per file. Bounds both node size and the cost of the jaccard overlap theco_changedrule runs over that list. - SNAPSHOT_
WAL_ BYTES - WAL bytes past the last snapshot that make writing a new one worthwhile.
- SYNCED_
AT - Marker prop holding when this store last took data from the repository.
Functions§
- format_
ingest_ git - format_
sync - format_
sync_ json - One
SyncReportas a single JSON object, forsync --json. - format_
touch - run_
ingest_ git - run_
sync - Bring the store up to date with the repository it was built from: the
commits since the marker, then the working tree where it differs from
HEAD. - run_
touch - Re-extract exactly the files named, and nothing else.