-
Notifications
You must be signed in to change notification settings - Fork 343
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
jj config list
: escape keys
#3725
Conversation
Fixes jj-vcs#1322. There may be more places where keys need escaping, I'm not completely sure.
Copying from Discord, the values are currently escaped in https://github.com/martinvonz/jj/blob/1f7c4ec60ab4c430ea46c141d8f46f144cfbec18/cli/src/cli_util.rs#L2132-L2150. I'm not sure at the moment whether that's 100% correct or whether it should also use |
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.
Thanks!
PS. I'm also not sure about the value escaping. It seems to rely on TOML and Rust's debug formatting to be the same. I haven't checked if that's correct. We can fix that separately anyway.
There's also the pathological case of a value like But, I guess, we can indeed leave it for later. |
Follows up on jj-vcs#3725 Apart from the bugfix, this also makes `jj config list` output ``` template-aliases.builtin_log_node=""" coalesce( if(!self, label(\"elided\", \"~\")), label( separate(\" \", if(current_working_copy, \"working_copy\"), if(immutable, \"immutable\"), if(conflict, \"conflict\"), ), coalesce( if(current_working_copy, \"@\"), if(immutable, \"◆\"), if(conflict, \"×\"), \"○\", ) ) ) """ ``` instead of ``` template-aliases.builtin_log_node="coalesce(\n if(!self, label(\"elided\", \"~\")),\n label(\n separate(\" \",\n if(current_working_copy, \"working_copy\"),\n if(immutable, \"immutable\"),\n if(conflict, \"conflict\"),\n ),\n coalesce(\n if(current_working_copy, \"@\"),\n if(immutable, \"◆\"),\n if(conflict, \"×\"),\n \"○\",\n )\n )\n)\n" ```. `toml_edit` also seems to use single-quoted strings sometimes.
Follows up on jj-vcs#3725 Apart from the bugfix, this also makes `jj config list` output ``` template-aliases.builtin_log_node=""" coalesce( if(!self, label(\"elided\", \"~\")), label( separate(\" \", if(current_working_copy, \"working_copy\"), if(immutable, \"immutable\"), if(conflict, \"conflict\"), ), coalesce( if(current_working_copy, \"@\"), if(immutable, \"◆\"), if(conflict, \"×\"), \"○\", ) ) ) """ ``` instead of ``` template-aliases.builtin_log_node="coalesce(\n if(!self, label(\"elided\", \"~\")),\n label(\n separate(\" \",\n if(current_working_copy, \"working_copy\"),\n if(immutable, \"immutable\"),\n if(conflict, \"conflict\"),\n ),\n coalesce(\n if(current_working_copy, \"@\"),\n if(immutable, \"◆\"),\n if(conflict, \"×\"),\n \"○\",\n )\n )\n)\n" ```. `toml_edit` also seems to use single-quoted strings sometimes.
Fixes #1322. There may be more places where keys need escaping, I'm not completely sure.
Checklist
If applicable:
CHANGELOG.md