Repository navigation
Keep only non-default values in the config file - #62
Merged
Merged
Conversation
thesiti92
force-pushed
the
feat/sparse-config
branch
from
September 30, 2026 20:42
9d3b123 to
2e9e0af
Compare
thesiti92
added this pull request to stack #66
October 1, 2026 14:23
sidkmenon
approved these changes
Oct 1, 2026
config set used to write every resolved default on the first edit (3506fb2), so files kept a frozen copy of the defaults of their time and later default changes, such as a new default prompt or a new bundled plugin, never reached them. Now each write drops every key whose removal leaves the resolved configuration unchanged, and reads treat the old default prompts as unset until 2026-12-31. Both live in config/prune.rs.
A note in the file marks intent, so a commented key or table is never pruned or hidden. Tables that only held pruned tables now go too, and pruning stops if the file does not resolve.
Every setting the schema declares is dropped at its default and kept otherwise. 400 seeded files of random settings, comments, headers and old default prompts must keep their meaning, prune idempotently, keep every comment, leave nothing removable and not depend on key order. This found that instances resolved differently when set to its default, so resolution now fills it in like enabled.
Serial plugins do not offer the setting, so config show no longer lists it for them.
thesiti92
force-pushed
the
feat/sparse-config
branch
from
October 1, 2026 14:56
214b52c to
4830917
Compare
sidkmenon
approved these changes
Oct 1, 2026
Merged
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.
Stacked on #60.
Why.
config setwrote every resolved default into~/.config/diffr/config.tomlon the first edit (3506fb2, "Materialize full configuration on edit"). Files therefore kept a frozen copy of the defaults of their time. Later default changes, such as #60's new summary prompt or a newly bundled plugin inorder, never reached them. This reverses that decision.What changes
config setdrops every key whose removal leaves the resolved configuration unchanged, then every table left without values.versionstays.plugins.orderstays, because removing it would change membership. Anorderequal to the default goes.plugins.bundled.summarize.system_promptare treated as unset, so existing files pick up the current prompt. Temporary: remove after 2026-12-31.src/config/prune.rsand share one path-based remove.plugin.toml. A test keeps the link's line numbers accurate.Verified
cargo test,cargo xtask test-pluginsand the TUI's diffr tests all pass.instancesset to its default resolved differently from leaving it unset, so it was never pruned. Resolution now fills it in for parallel plugins, the same way it fills inenabled.config set. It resolves to the same configuration except the prompt, which is now the current default.Trade-off. A value set to exactly today's default is no longer pinned against future default changes.