Skip to main content

Module config

Module config 

Source
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.
ConfigLayer
One configuration layer (a single file’s settings, or flags); every field is optional and only present keys override lower layers.

Enums§

SubmoduleInit
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/never decide without a prompt.

Functions§

global_config_path
The path to the global config.toml, honoring $XDG_CONFIG_HOME and falling back to the platform config directory. None only if no home directory can be determined.
load
Loads and merges the global and per-repo configuration over the defaults. repo_root is None when 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.toml at repo_root.