Repository navigation
fix(config): point system-config deprecation hints at the file, not wt config update - #4767
Merged
Merged
Conversation
…t config update A deprecated setting in the system config printed the generic hint "to apply updates, run wt config update", but `wt config update` only rewrites user and project config, so following it reported nothing to do. The system config now gets its own hint naming the file to edit. A user config deprecation in the same run keeps the `wt config update` hint. Also corrects deprecation.rs doc comments that called the template-variable rename cosmetic and update-only (it is a structural load-time rule) and that inverted which callers pass `emit_inline_warnings = false`.
1 task
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When the system config (e.g.
/etc/xdg/worktrunk/config.toml) contains a deprecated setting, every command printed the generic hintTo see details, run wt config show; to apply updates, run wt config update. Neither command acts on the system config:wt config updateonly checks the user and project files and answers "No deprecated settings found", andwt config showrenders no deprecation details for the system section. So the hint led nowhere.The system config now gets its own hint:
The generic hint is shown at most once per process. Previously a system-config deprecation could use it up before the user config was checked. Now the system hint has its own path, so a user-config deprecation in the same run still prints the
wt config updatehint. The path reaches users throughUserConfig::load_with_warnings, which runscheck_and_migrateon the system file with inline warnings on.The new
test_system_config_deprecation_hint_points_at_the_filefailed before the fix: stderr containedrun wt config update. It covers both the system-only case and the case where both files are deprecated.The same file also had stale doc comments, now corrected:
migrate_content_docandapply_rulessaid the template-variable rename is a cosmetic, update-only rule. It is a structural rule applied on every load.check_and_migratesaidemit_inline_warnings = falseis for commands other thanconfig show. In factwt config showandwt config updateare the callers that passfalse.