Skip to content
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

config: refactor and move config set/unset functions to jj-lib #5093

Merged
merged 5 commits into from
Dec 14, 2024

Conversation

yuja
Copy link
Collaborator

@yuja yuja commented Dec 13, 2024

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

yuja added 5 commits December 13, 2024 20:16
write_config_value_to_file() will be inlined to callers.
Since .get("path.to.non-table.children") returns NotFound, I made
.delete_value() not fail in that case. The path doesn't exist, so
.delete_value() should be noop.

remove_config_value_from_file() will be inlined to callers.
I'm going to remove write/remove_config_value_to/from_file() functions, but I
don't want to copy layer.path.expect(..) to all callers.
They are short, and it wouldn't make much sense to do load, mutate one entry,
and save in one function.

In later patches, "jj config set"/"unset" will be changed to reuse the loaded
ConfigLayer if the layer can be unambiguously selected.
@yuja yuja merged commit ef724d2 into jj-vcs:main Dec 14, 2024
18 checks passed
@yuja yuja deleted the push-umwpyxzotrnu branch December 14, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants