-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The current config order is ~/.config/lab, . (dot, ie the local directory), and then .git/lab/. Viper uses a first-found algorithm to find the configs; if a config is found in the local directory, then the config in .git/lab/ will not be used. This model is different from the standard git model of allowing more local configs to override higher order configs. In git the ~/.gitconfig file is overriden by any settings in .git/config. This model is likely preferred by most lab users and would allow per-worktree settings of the host and token. To be clear the new ordering and behaviour is The lab config heirarchy is: 1. ENV variables (LAB_CORE_TOKEN, LAB_CORE_HOST) - if specified, core.token and core.host values in config files are not updated. 2. "dot" . user specified config - if specified, lower order config files will not override the user specified config 3. .config/lab/lab.toml (global config) 4. .git/lab/lab/toml (worktree config) Viper does not have a MergeInConfig() but does allow the merging of data through MergeConfig(). I've used this to merge in the worktree config. Rework the config ordering to allow for config overrides. Signed-off-by: Prarit Bhargava <prarit@redhat.com>
- Loading branch information
Showing
5 changed files
with
80 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters