jjcat: Safety UX for Mutable Version-Control History
A Jujutsu desktop client needs to check which history the user intends to change. Before execution, it must check that the target and repository state still match the preview. Users also need a way to recover afterward.
Question
What should users review when commit history can be rewritten and the working copy is itself a commit? How can a new operation restore an earlier repository state?
Main idea
Users need to see the target, expected effect, and recovery path before changing history. The preview, confirmation, and recovery steps should suit the operation.
About this draft
Sources and scope
Sources
The case study draws on the public jjcat architecture and implementation. It covers local and SSH drivers, tokens that identify a preview, the operation queue, and limits on how much repository state is loaded for the UI.
Limits
Implemented features and planned work will be labeled separately. The article does not present jjcat as a mature replacement for established clients.
Outline
What the article will cover
- 01
Explain how Jujutsu changes the workflow
Commit history can be rewritten, and the working copy is itself a commit. Users need to review that state before acting. The operation log separately records repository states for recovery.
Example or checkCompare familiar Git labels and workflows with the corresponding Jujutsu operations.
- 02
Check that execution matches the preview
A preview must identify the repository, current operation, target, and intended effect. Execution must check that these still match the preview.
Example or checkFollow the token that identifies the preview. Check rejection when the recorded state is stale or execution is requested twice.
- 03
Run one change at a time and check the result
After a command succeeds, re-query the repository and check that its state matches what the user approved.
Example or checkShow the per-repository queue, the new operation ID, and the refreshed repository view.
- 04
Match the steps to the risks
Undoable local edits, destructive workspace removal, and remote publication need different safeguards and recovery effort. Preview, confirmation, and recovery should match the risks of each operation.
Example or checkCompare the preview, confirmation, execution, and recovery steps for representative operations.
- 05
Keep the workflow consistent for local and SSH repositories
Keep the same workflow for local and SSH repositories. Handle credentials, latency, caching, and failures separately for each transport.
Example or checkCompare the driver interfaces and explain which local and SSH behaviors should differ.
- 06
Separate implemented features from plans
Separate implemented behavior from planned work. For each planned feature, name the test that would show it is ready.
Example or checkUse a table of implemented and planned features. State the test needed for each planned feature.
Before publication
What still needs checking
Repository state
Compare Git-client assumptions with Jujutsu working-copy commits, operations, bookmarks, and workspaces.
One history change
Follow the preview, the repository state it records, rejection after that state changes, queued execution, the refreshed view, and recovery.
Checks and recovery
For each operation, compare whether it can be undone, what happens remotely, whether data can be lost, and how clearly the target is identified.
Implemented and planned features
Separate the available read operations and implemented safety checks from history-changing workflows that still need implementation.