Expand description
Configuration loading and merging (spec §11).
Two file layers are merged over the built-in defaults: the global
config.toml (under the platform config dir or $XDG_CONFIG_HOME/wt) and
the per-repo .wt.toml at the repo root. Per-repo overrides global; both are
parsed and validated on every invocation (load).
Re-exports§
pub use wtconfig::WtMeta;
Modules§
- wtconfig
- Per-worktree metadata stored in Git config under the
wt.*namespace (spec §3/§7/§11): the base ref, originating PR number, and a “created by wt” flag.
Structs§
- Config
- The fully-resolved configuration after merging all layers.
- Config
Layer - One configuration layer (a single file’s settings, or flags); every field is optional and only present keys override lower layers.
Enums§
- Submodule
Init - When to initialize git submodules after a worktree is created or a branch is
checked out (
[submodules] init, issue #50). The default (Prompt) asks before initializing at an interactive terminal;always/neverdecide without a prompt.
Functions§
- global_
config_ path - The path to the global
config.toml, honoring$XDG_CONFIG_HOMEand falling back to the platform config directory.Noneonly if no home directory can be determined. - load
- Loads and merges the global and per-repo configuration over the defaults.
repo_rootisNonewhen not inside a repository (only the global layer is considered). - parse_
layer - Parses and validates a config file’s text into a
ConfigLayer. - repo_
config_ path - The path to the per-repo
.wt.tomlatrepo_root.