-
Notifications
You must be signed in to change notification settings - Fork 357
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
Add new command jj config unset
#4547
Conversation
a1925ce
to
9b66e8c
Compare
a281997
to
910f709
Compare
a7a711f
to
ee92399
Compare
ee92399
to
d9b0c4c
Compare
d9b0c4c
to
239f850
Compare
I would like to get some feedback on my changes. I left some open questions as inline comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks generally good to me, thanks.
@yuja, thanks for your quick feedback! I will address your comments over the next couple of days and let you know when I'm done. |
c8bcdb8
to
edaede3
Compare
edaede3
to
56f3e7b
Compare
56f3e7b
to
8860433
Compare
ed2cd1c
to
b8192b8
Compare
@yuja, thanks again for taking the time to look through my changes. I addressed your comments, so the changes are ready for another review. For your sake, I hope this is the last round trip. 🤞 I also added a test case for unsetting keys of inline tables, making it more explicit that we do not support this at the moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
b8192b8
to
1d7c642
Compare
This is a preparatory refactoring. We will introduce another function to remove config values, in which we will reuse these two helper functions.
Allow unsetting config values similar to `git config unset`. ```bash $ jj config set --user some-key some-val $ jj config get some-key some-val $ jj config unset --user some-key $ jj config get some-key Config error: configuration property "some-key" not found For help, see https://martinvonz.github.io/jj/latest/config/. ``` Unsetting a key, which is part of a table, might leave that table empty. For now we do not delete such empty tables, as there may be cases where an empty table is semantically meaningful (jj-vcs#4458 (comment)). For example: ```toml [table] key = "value" [another-table] key = "value" ``` Running `jj config unset --user table.key` will leave us with `table` being empty: ```toml [table] [another-table] key = "value" ```
1d7c642
to
90f2c1a
Compare
Allow unsetting config values similar to
git config unset
.Unsetting a key, which is part of a table, might leave that table empty. For now we do not delete such empty tables, as there may be cases where an empty table is semantically meaningful (#4458 (comment)).
For example:
Running
jj config unset --user table.key
will leave us withtable
being empty:Closes #4458
Checklist
If applicable: