sincecutoff.com
← all changes

jj configuration supports environment-based conditions

Introduced 2026-03-04 · score 0.94

HOW TO USE IT

When a repository development setting should apply only under an environment condition, add a conditional scope to jj configuration. Use `--when.environments` with `NAME=VALUE` to match a value or `NAME` to match whenever the variable is set.

[[--scope]] --when.environments = ["<NAME>=<VALUE>"] [--scope.<section>] <key> = "<value>"

WHY THIS HELPS

Apply a jj configuration condition based on environment variables in a repository development setup.

REQUIREMENTS AND LIMITATIONS

  • Version: v0.39.0
  • --when.environments (required): List of environment conditions. Each item is `NAME=VALUE` to match that value, or `NAME` to match if set. Items in the list are alternatives (OR).
  • --scope (required): Conditional configuration table; its variables are expanded to the root config table.
  • Multiple condition keys: If multiple `--when` conditions are specified, their intersection is used (AND).

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card