diff --git a/CHANGELOG.md b/CHANGELOG.md index ad2232a3ee..d08cb822c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/config.md b/docs/config.md index d6043042f5..59a038c4b2 100644 --- a/docs/config.md +++ b/docs/config.md @@ -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 + 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 @@ -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 @@ -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