Quote Revsets and Shell Syntax

VCS-QUOTE-REVSETS-AND-SHELL-SYNTAX

Summary

Quote jj revsets, bookmark syntax, and other shell-sensitive command fragments. Shell metacharacters can alter commands, so examples should prefer simple safe quoting.

Rule

Quote revsets and shell-sensitive syntax.

Why

Revsets and bookmark syntax often contain characters such as @, |, &, ~, parentheses, or spaces that shells can interpret. Unquoted syntax can run a different command than intended or fail in confusing ways.

Helps

  • Prevents shell parsing bugs in jj examples, scripts, and agent commands.

Limits

Quoting style depends on shell and context. Prefer simple single quotes in shell examples unless interpolation is needed.

Agent Instruction

Quote revsets and shell-sensitive syntax because revsets and bookmark syntax often contain characters
such as `@`, `|`, `&`, `~`, parentheses, or spaces that shells can interpret.

Mechanisms

Supported by quoted examples, script tests, shellcheck where applicable, and checking jj help for revset syntax before publishing commands.

References