Skip to main content

Crate jj_hooks

Crate jj_hooks 

Source
Expand description

Library entrypoint shared by the jj-hooks and jj-hp binaries.

Both binaries are identical — jj-hp is just a shorter name that’s easier to type and that we route the jj push alias through.

Modules§

bookmark_updates
cli
clap argument structs for the jj-hooks binary.
completions
Shell completion support.
error
hooks
Per-bookmark hook execution pipeline.
init
jj-hooks init — interactive setup for the user-level config.
jj
Subprocess wrapper around the jj CLI plus utilities for locating the primary git directory that a (primary or secondary) workspace is colocated with.
push
Push pipeline: dry-run parse → per-bookmark hook → push or abort.
push_tags
jj-hp push-tags — push jj tags to a git remote.
runner
Hook runner backends.
setup
Pre-hook setup steps run inside the ephemeral worktree.
worktree
Ephemeral git worktree used to run hooks at a target commit without disturbing the user’s working copy or polluting the shared .git/index.

Functions§

run
Parse CLI args, dispatch to a subcommand, and return the process exit code. Both bin/jj-hooks and bin/jj-hp are trivial wrappers around this function.
run_for_revset
Run the configured hook runner against a jj revset, the same way jj-hp run [REVSET] does. Exposed as a library entrypoint so other tools (e.g. jj-gt) can gate their own pipelines on the same hook machinery without shelling out to the jj-hp binary.
run_for_revset_outcome
Structured variant of run_for_revset — returns Ok(None) for an empty revset, otherwise the per-update hooks::HookOutcome.