Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: add function to resolve conditional tables
This provides an inline version of Git's includeIf. The idea is that each config layer has an optional key "--when" to enable the layer, and a layer may have multiple sub-layer tables "--scope" to inline stuff. Layers can be nested, but that wouldn't be useful in practice. I choose "--" prefix to make these meta keys look special (and are placed earlier in lexicographical order), but I don't have strong opinion about that. We can use whatever names that are unlikely to conflict with the other config sections. resolve() isn't exported as a StackedConfig method because it doesn't make sense to call resolve() on "resolved" StackedConfig. I'll add a newtype in CLI layer to distinguish raw config from resolved one. Most consumers will just see the "resolved" config. jj-vcs#616
- Loading branch information