In short: one clap enum, hidden from jj --help, dispatching to fifteen small commands. Each
picks how much of jj to load. Most go through the normal workspace helper; the index commands and
debug object load only the workspace, so they can run when the repo itself would not load.
The group is DebugCommand, help text "Low-level commands not
intended for users", marked #[command(hide = true)] (source).
It is the Debug variant of the top-level Command enum
(source, dispatch), and
cmd_debug matches on it.
1. Command-line surface
| Subcommand | Help text | Loads |
|---|---|---|
copy-detection | "Show information about file copies detected" | workspace helper (source) |
fileset | "Parse fileset expression" | workspace helper (source) |
index | "Show commit index stats" | workspace only (source) |
index-changed-paths | "Build changed-path index" | workspace helper (source) |
init-simple | "Create a new repo in the given directory using the proof-of-concept simple backend" | nothing; creates a repo |
local-working-copy | "Show information about the local working copy state" | workspace helper (source) |
object (commit, file, operation, symlink, tree, view) | "Show information about an operation and its view", the doc comment on the whole enum | workspace only, then the commit or op store (source) |
reindex | "Rebuild commit index" | workspace only (source) |
revset | "Evaluate revset to full commit IDs" | workspace helper (source) |
snapshot | "[DEPRECATED] Trigger a snapshot in the op log"; also hidden | workspace helper (source) |
stacked-table | "Show stats of stacked table" | nothing; opens the table store at DIR with key size -n (source) |
template | "Parse a template" | nothing; parses and prints the AST (source) |
tree | "List the recursive entries of a tree." | workspace helper (source) |
watchman (status, query-clock, query-changed-files, reset-clock) | none on the group; status: "Check whether watchman is enabled and whether it's correctly installed" | workspace helper (source) |
working-copy | "Show information about the working copy state" | workspace helper without snapshot (source) |
The enum lists the variants in this order (source). The global flags are on the CLI page.
3. End-to-end flow
4. Core architecture touchpoints
| Piece | Role here |
|---|---|
| Index | debug reindex resolves the operation before loading the repo, "The index might have to be rebuilt while loading the repo", then calls reinit and build_index_at_operation on the default index store; any other index type is "Cannot reindex indexes of type '…'" (source, test). debug index prints its stats (test). |
| Commit store and op store | debug object reads a commit, file, symlink or tree from the store, or an operation or view from the op store, by ID (source). |
| Revsets, filesets, templates | debug revset and fileset print each parser's intermediate forms; debug template prints the parsed template tree (source) (fileset test, revset test). |
| Working copy | check_local_disk_wc downcasts to LocalWorkingCopy, failing with "This command requires a standard local-disk working copy" (source); debug local-working-copy and the watchman queries call it (source, watchman). debug snapshot only warns that it is deprecated and calls the workspace helper, which snapshots; use jj util snapshot (source). |
| Build features | debug watchman fails with "Cannot query Watchman because jj was not compiled with the watchman feature" when that feature is off (source); it is on by default (source). |