# JJ Command Syntax Reference ## The `-r` Flag Confusion JJ commands are **inconsistent** with flag naming, which can be confusing: ### Commands Using `-r` (Most Common) ```bash jj log -r # ✅ Short form only jj desc -r # ✅ Short form only jj show -r # ✅ Short form only jj rebase -r # ✅ Short form only jj edit -r # ✅ Short form only (no --revision) ``` **Rule:** For most commands, use `-r` and **never** `--revisions` or `--revision`. ### Why This Matters ```bash # ❌ Common mistake: trying long form jj desc --revisions xyz # Error: unexpected argument '--revisions' found jj log --revision xyz # Error: unexpected argument '--revision' found # ✅ Always use short form jj desc -r xyz jj log -r xyz ``` ## Command Patterns ### Reading Revision Info ```bash # Get description only (for processing) jj log -r -n1 --no-graph -T description # Get detailed info (human-readable) jj log -r -n1 --no-graph -T builtin_log_detailed # Get compact one-liner jj log -r -T 'change_id.shortest(4) ++ " " ++ description.first_line()' ``` **Key flags:** - `-n1`: Limit to 1 revision - `--no-graph`: No ASCII art graph - `-T