-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: inline TOML tables are processed differently from non-inline tables #5255
Comments
core.watchman.register_snapshot_trigger
in a config. section causes an error on all CLI invocationscore.watchman.register_snapshot_trigger
in a config. section causes an error on most CLI invocations
It's actually "broken" by 0de3691, and the change was intentional. We have to merge multiple TOML documents into a single table, which is something that is TOML but duplicated keys are allowed. I decided to not take inline table as a merge-able table because it would probably make sense to override the default That said, if the new behavior is super confusing, maybe we should revert the change and take inline table as mergeable item. |
FWIW I find this behaviour extremely surprising, as I see the difference as being purely syntactic sugar. |
core.watchman.register_snapshot_trigger
in a config. section causes an error on most CLI invocations
We can revert the merging/lookup change, but we'll still need some behavior differences in CLI. For example,
(This depends on the current merging rules. If inner values of inline tables were merged, each inner value would have "overridden" flag.) |
I do find it very confusing, so it seems to me like we should revert it, even if that makes some other things worse again. |
Ok. Things would get worse if we had an array of tables, but that's not a problem right now. For consistency, maybe we can also disable |
As a CLI tool author myself, it's very strange to treat user TOML documents as anything other than a way to write a layer of data. Actually using syntax for anything other than specifying the map/dictionary structure that may get merged against something else seems a recipe for confusion. |
Just to clarify, you mean, in TOML-based configuration:
|
This backs out commit 0de3691. Documentation, tests, and comments are updated accordingly. I also add ConfigTableLike type alias as we decided to abstract table-like items away. Closes jj-vcs#5255
Description
Setting
core.fsmonitor
to"watchman"
andcore.watchman.register_snapshot_trigger
using a table section in configuration:…rather than fully qualified key paths, as documentation suggests:
…now causes a configuration error that blocks most invocations of
jj
. 😱 This is a problem, because these are supposed to be equivalent in TOML, butjj
apparently treats them differently.I've bisected this issue to e5361c6 (CC @yuja).
Steps to Reproduce the Problem
With
jj
0.25.0, use a configuration with the followingcore
section:Run a
jj
command that loads configuration as one of its steps, i.e.,jj log
. Observe that only the following message is printed, with a non-zero exit code:Comment out configuration of one of these
core
keys. Observe that the error goes away, andjj
works as before.Expected Behavior
I expect "bare" key paths and key paths in sections to have the same config. behavior, in general.
Specifications
Reproduced on macOS 15.1.1 and Windows 11.
The text was updated successfully, but these errors were encountered: