Skip to content

Commit

Permalink
config.md docs: document jj config edit and jj config path
Browse files Browse the repository at this point in the history
This changes the intro section to recommend using `jj config edit` to
edit the config instead of looking for the files manually.
  • Loading branch information
ilyagr committed Feb 3, 2024
1 parent 8170a6d commit 54a3738
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,29 @@ These are the config settings available to jj/Jujutsu.

## Config files and TOML

The config settings are loaded from the following locations. Less common ways to
specify `jj` config settings are discussed in a later section.
`jj` loads several types of config settings:

* [The user config file]
* `.jj/repo/config.toml` (per-repository)
- The built-in settings. These cannot be edited. They can be viewed in the
`cli/src/config/` directory in `jj`'s source repo.

See the [TOML site] and the [syntax guide] for a description of the syntax.
- The user settings. These can be edited with `jj config edit --user`. User
settings are located in [the user config file], which can be found with `jj
config path --user`.

[The user config file]: #user-config-file
- The repo settings. These can be edited with `jj config edit --repo` and are
located in `.jj/repo/config.toml`.

- Settings [specified in the command-line](#specifying-config-on-the-command-line).

These are listed in the order they are loaded; the settings from earlier items
in
the list are overridden by the settings from later items if they disagree. Every
type of config except for the built-in settings is optional.

See the [TOML site] and the [syntax guide] for a detailed description of the
syntax. We cover some of the basics below.

[the user config file]: #user-config-file
[TOML site]: https://toml.io/en/
[syntax guide]: https://toml.io/en/v1.0.0

Expand Down Expand Up @@ -561,7 +575,17 @@ executable on your system](https://facebook.github.io/watchman/docs/install).

Debugging commands are available under `jj debug watchman`.

# User config file
## Ways to specify `jj` config: details

### User config file

An easy way to find the user config file is:

```bash
jj config path --user
```

The rest of this section covers the details of where this file can be located.

On all platforms, the user's global `jj` configuration file is located at either
`~/.jjconfig.toml` (where `~` represents `$HOME` on Unix-likes, or
Expand All @@ -584,6 +608,8 @@ default locations. For example,
env JJ_CONFIG=/dev/null jj log # Ignores any settings specified in the config file.
```

### Specifying config on the command-line

You can use one or more `--config-toml` options on the command line to specify
additional configuration settings. This overrides settings defined in config
files or environment variables. For example,
Expand Down

0 comments on commit 54a3738

Please sign in to comment.