Skip to content

Commit

Permalink
config.md docs: document jj config edit
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 1, 2024
1 parent 2b97c78 commit 6c0d71e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `jj config list` now accepts `--user` or `--repo` option to specify
config origin.

* `jj config edit` can now print the config file path with the `--print-path`
option.

* `jj tag list` command prints imported git tags.

* `jj next` and `jj prev` now prompt in the event of the next/previous commit
Expand Down
36 changes: 29 additions & 7 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,26 @@ 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 default settings. These cannot be edited.

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` and are
located in [the user config file].

[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`.

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

These are listed in the order they are loaded; the config listed earlier would
be overriden by the config listed later if they disagree. Every type of config

Check failure on line 21 in docs/config.md

View workflow job for this annotation

GitHub Actions / Codespell

overriden ==> overridden
except for the default 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 +572,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 edit --user --print-path
```

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 @@ -583,6 +604,7 @@ default locations. For example,
```shell
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
Expand Down

0 comments on commit 6c0d71e

Please sign in to comment.