Skip to content

snapshots

Extract a repo at sampled revisions into a temporal store (model.db).

Synopsis

codegraph snapshots [repo] --extractor FILE [--every N] [--tags] [--store FILE] [--src DIR] [--json]

Arguments

ArgumentMeaningDefault
<repo>Path to the repository to snapshot..

Options

OptionMeaningDefault
--extractor FILEThe extractor run at every revision, as a path: a .jar (run with java -jar), a .js (run with node), or an executable such as the installed codegraph-java ($(command -v codegraph-java)) or codegraph-csharp. All honour the extractor command-line contract.required
--jar FILEAlias of --extractor, kept for the form --jar codegraph-java.jar.—
--every NSnapshot every Nth first-parent commit, oldest first; the tip is always included.—
--tagsSnapshot the commits the repo’s tags point at instead (releases as keyframes).—
--store FILEThe temporal store to append to; defaults to -model.db.—
--src DIRDirectory to extract, relative to the repo root (default: the whole repo).—
--jsonPrint the same information as a machine-readable JSON object on stdout.—
-h, --helpShow this help.—

Exit codes

0 ok · 1 internal error (a bug) · 2 usage error · 3 findings.

3 when any sampled revision failed to extract; the failures are listed and the successful frames stay in the store.

Example

$ codegraph snapshots . --jar extractors/java/target/codegraph-java.jar --tags --store /tmp/temporal.db

The command runs the extractor once per sampled revision, each in a throwaway git worktree; a rerun skips the revisions the store already holds.

See also

model.db · Java extractor · CLI conventions

Last updated on