d39f883b4e
Migrate to only doing marshalling twice, and compare via deep copy
2025-02-27 17:05:31 -05:00
87c3e75811
Use indentation of 2 when rewriting auto-migrated config file
...
This seems to be what most people use when indenting yaml files, and it seems to
make more sense than the default of 4.
We also use it the example config in Config.md.
2025-02-23 11:32:12 +01:00
2fa4ee2cac
feat: Support multiple commit prefixes
...
This implementation, unlike that proposed in https://github.com/jesseduffield/lazygit/pull/4253
keeps the yaml schema easy, and does a migration from the single
elements to a sequence of elements.
2025-02-17 19:58:31 +01:00
dd6bfa1680
chore: use errors.New to replace fmt.Errorf with no parameters.
2024-04-24 16:21:34 +08:00
4d8b8b647a
Introduce a yaml_utils.Walk function
2024-03-29 17:55:06 +01:00
c4a2749a99
Avoid rewriting the file if nothing changed
...
This avoids changing the indentation or number of blank lines etc unnecessarily
if nothing has changed.
2023-06-26 08:11:10 +02:00
85f293af1a
Add new function RenameYamlKey
2023-06-26 08:11:10 +02:00
9cbd7fe69e
Extract a lookupKey function that will be useful in the next commit
2023-06-26 08:11:10 +02:00
4461dc68b7
Create missing path elements
...
This fixes a serious error: trying to change a value on gui.someOption would add
a someOption key at root if gui doesn't exist.
2023-06-26 08:11:10 +02:00
6acabba417
Return an error if some node in the path is not a dictionary
2023-06-26 08:11:10 +02:00
7fb86d6e9c
Return an error if node to be updated is not a scalar
2023-06-26 08:11:10 +02:00
221433522d
Return an error if document is not a dictionary
2023-06-26 08:11:10 +02:00
90084d115e
Support updating values in empty documents
2023-06-26 08:11:10 +02:00
a14794bf5c
Rename UpdateYaml to UpdateYamlValue
...
We are going to add other ways to update yaml documents in the future.
2023-06-26 08:11:10 +02:00
e156e090cc
add ability to update yaml path while preserving comments
2023-05-10 22:31:27 +10:00