Skip to content

Commit

Permalink
docs config: an advanced example of --config syntax
Browse files Browse the repository at this point in the history
This seems non-trivial to discover and could be useful for people
transitioning from `--config-toml`.
  • Loading branch information
ilyagr committed Jan 15, 2025
1 parent ac1be93 commit c3c2e88
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -1319,11 +1319,20 @@ to specify additional configuration settings. This overrides settings defined in
config files or environment variables. For example,

```shell
jj --config=ui.color=always --config=ui.diff-editor=kdiff3 split
# Must not have spaces around the `=`
jj --config ui.color=always --config ui.diff-editor=kdiff3 split
```

Config value should be specified as a TOML expression. If string value doesn't
contain any TOML constructs (such as array notation), quotes can be omitted.
Here is an example with more advanced TOML constructs:

```shell
# Single quotes and the '\' are interpreted by the shell and assume a Unix shell
# Double quotes are passed to jj and are parsed as TOML syntax
jj log --config \
'template-aliases."format_timestamp(timestamp)"="""timestamp.format("%Y-%m-%d %H:%M %:::z")"""'
```

To load an entire TOML document, use `--config-file`:

Expand Down

0 comments on commit c3c2e88

Please sign in to comment.