DashboardCodejj workspace add -r HEAD

jj workspace add -r HEAD

Category: gotcha
Confidence: 1.00
ID: 01a0813c-7993-79ae-8826-9ec8c3a864d5
Project ID: ffa98226-3908-4f0c-936b-969018c62abf
Cross-project: No
Recalled in other projects: 2
Source session: 1PK19ihyTZUg5z05l
Created: 2026-09-08 13:36:59
Updated: 2026-09-08 13:36:59

Cross-Project Recalls

ProjectHitsLast recalled
opencode-lore 1 1d ago
opencode 1 8d ago

Content

Trap: assuming jj workspace add -r <rev> makes Git resolve <rev> from the primary worktree looks natural because Git worktrees normally start from a Git revision. Fix: jj creates an orphan worktree, populates it itself, then exports Git HEAD to the requested revision’s Git commit. A validated non-tip -r @-- workspace had detached Git HEAD exactly equal to first, not the primary worktree’s second; root() correctly leaves Git HEAD unborn at refs/jj/root.

Move to: