jj VCS API
JJHub is a jj-native platform. All version control operations use jj concepts: Change IDs, Bookmarks, Operation Logs, and stacked changes. These endpoints provide direct access to jj VCS operations on repositories.Bookmarks
Bookmarks are jj’s equivalent of Git branches. Unlike Git branches, bookmarks are explicit pointers that don’t automatically advance - you must explicitly move them.List Bookmarks
Create Bookmark
Get Bookmark
Update Bookmark
Delete Bookmark
Changes
A Change is jj’s equivalent of a commit, but with a stable Change ID that persists even when the commit is amended or rebased. Every change has:- A Change ID: a stable identifier (e.g.
wqnwkozp) that never changes - A Commit ID: the underlying Git commit hash (changes on amend)
- A description: the commit message
- One or more parents: the change’s ancestors
List Changes
Returns the change tree (commit graph) for a repository.
Response:
Link and X-Total-Count headers described in the Pagination guide.
Get Change
Diffs
Get Change Diff
Returns the diff for a specific change.
Response:
Operation Log
The Operation Log is one of jj’s most powerful features. Every jj operation (commit, rebase, undo, etc.) is recorded in the operation log, making any operation undoable. This is analogous to Git’s reflog but for all operations, not just branch moves.List Operations
Response:
Link and X-Total-Count headers described in the Pagination guide.
Stacked Changes
JJHub’s premiere feature is first-class support for stacked changes - a series of changes where each builds on the previous. This enables incremental review and is particularly powerful for AI-assisted development. A stack looks like:Commit Statuses
Commit statuses let external systems (CI/CD pipelines, code quality tools, security scanners) report the outcome of checks against a specific commit. Statuses are the mechanism by which JJHub knows whether a change has passed CI, failed a linter, or is still being validated. Statuses are the foundation for two key features:jjhub land checks— shows the CI status of all changes in a landing request- Bookmark protection — the
--require-status-checksrule gates landing until all statuses reportsuccess
Status States
Each status has astate field with one of four values:
Both
failure and error block landing when --require-status-checks is enabled on the target bookmark. The distinction exists so operators can differentiate between “the code has a problem” (failure) and “the CI system has a problem” (error).
Context
Each status is identified by acontext string that names the check. Multiple statuses can exist on the same commit as long as they have different contexts. Examples:
If a new status is posted with the same
context as an existing status on the same SHA, the existing status is replaced. This is how a workflow updates a status from pending to success or failure.
Create a Commit Status
Report the result of a check against a specific commit SHA.
Example:
Get Commit Statuses
Retrieve all statuses reported against a commit ref (SHA, bookmark name, or change ID).
Query parameters:
Example:
Combined Status
When multiple statuses exist on a commit, JJHub computes a combined status using these rules:
The combined status is what bookmark protection evaluates. If
--require-status-checks is enabled, the combined status of every commit in the landing request must be success for the merge to proceed.
The jjhub land checks command displays both individual statuses and the combined status:
How Workflows Set Statuses Automatically
When a JJHub workflow runs against a commit, the platform automatically manages commit statuses on behalf of the workflow:- Workflow starts — JJHub creates a
pendingstatus withcontextset to the workflow name (e.g.,ci/test). Thetarget_urlpoints to the workflow run’s log page. - Workflow completes successfully — JJHub updates the status to
successwith a description summarizing the result. - Workflow fails — JJHub updates the status to
failure(if the workflow’s steps failed) orerror(if the runner itself had a problem).
pending status with context ci/test on the triggering commit. When bun test succeeds, the status updates to success. If it fails, the status updates to failure.
How Statuses Gate Landing Requests
Statuses integrate with bookmark protection to enforce quality gates:-
Enable status checks on a bookmark:
-
Attempt to land a change: When
jjhub land landis called, JJHub checks the combined status of every commit in the landing request’s change stack. -
If any commit has a non-success combined status, the landing is blocked:
- Once all statuses are success, the landing proceeds (assuming other protection rules like required reviews are also satisfied).
success combined status. This ensures that each logical change in the stack is independently validated.
CLI: Commit Status Commands
List and set commit statuses from the command line:Webhook Events
When a commit status changes, JJHub fires astatus webhook event. This lets external systems react to CI outcomes — for example, sending a notification when a previously-failing check turns green.
The webhook payload includes the status details, the commit SHA, and the repository context. See the Webhooks API for delivery and signature details.