Repository navigation
fix(config): don't write the global config into a conf.d drop-in #11633
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
Merged
jdx
merged 1 commit into
jdx:main
from
JamBalaya56562:fix/global-config-path-skips-confd
Aug 2, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/usr/bin/env bash | ||
| # Writing to the global config must never land in a `conf.d` drop-in. | ||
| # | ||
| # `first_config_file` skips conf.d entries while choosing, but falls back to the | ||
| # first candidate when nothing else qualifies — and `config_files_from_dir` | ||
| # inserts conf.d entries first. A config dir holding only drop-ins therefore | ||
| # handed one back as the write target. | ||
| # | ||
| # See: https://github.com/jdx/mise/discussions/5842 | ||
|
|
||
| mkdir -p "$HOME/.config/mise/conf.d" | ||
| cat >"$HOME/.config/mise/conf.d/10-drop-in.toml" <<'TOML' | ||
| [env] | ||
| FROM_CONFD = "yes" | ||
| TOML | ||
|
|
||
| # the reported state: drop-ins exist, the global config itself does not | ||
| assert_fail "test -f $HOME/.config/mise/config.toml" | ||
|
|
||
| # the drop-in is loaded — the filter is about writing, not reading | ||
| assert_contains "mise env -s bash" "FROM_CONFD" | ||
|
|
||
| # A `.tool-versions` global config still wins over a drop-in, and skipping | ||
| # drop-ins must not divert those writes. This holds because | ||
| # `global_config_files()` inserts ~/.tool-versions ahead of the conf.d entries, | ||
| # so it — not a drop-in — is what the fallback returns; pin that ordering here. | ||
| printf 'dummy 1.0.0\n' >"$HOME/.tool-versions" | ||
| MISE_USE_TOML=false mise use -g dummy@system | ||
| assert_contains "cat $HOME/.tool-versions" "dummy" | ||
| assert_not_contains "cat $HOME/.config/mise/conf.d/10-drop-in.toml" "dummy" | ||
| assert_fail "test -f $HOME/.config/mise/config.toml" | ||
| rm "$HOME/.tool-versions" | ||
|
|
||
| # `mise use --global` creates the global config rather than editing the drop-in | ||
| mise use -g dummy@system | ||
| assert_contains "cat $HOME/.config/mise/config.toml" 'dummy = "system"' | ||
| assert_not_contains "cat $HOME/.config/mise/conf.d/10-drop-in.toml" "dummy" | ||
|
|
||
| # `mise set --global` and `mise settings set` resolve through the same function | ||
| mise set -g CONFD_GUARD=set | ||
| assert_contains "cat $HOME/.config/mise/config.toml" "CONFD_GUARD" | ||
| assert_not_contains "cat $HOME/.config/mise/conf.d/10-drop-in.toml" "CONFD_GUARD" | ||
|
|
||
| mise settings set jobs 3 | ||
| assert_contains "cat $HOME/.config/mise/config.toml" "jobs" | ||
| assert_not_contains "cat $HOME/.config/mise/conf.d/10-drop-in.toml" "jobs" | ||
|
|
||
| # removal goes to the same place, and the drop-in is still intact and loaded | ||
| mise unuse -y dummy@system | ||
| assert_not_contains "cat $HOME/.config/mise/config.toml" "dummy" | ||
| assert_contains "cat $HOME/.config/mise/conf.d/10-drop-in.toml" "FROM_CONFD" | ||
| assert_contains "mise env -s bash" "FROM_CONFD" |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.