RFR: 2080: ini: allow values to be updated

Erik Duveblad ehelin at openjdk.org
Fri Oct 27 13:17:19 UTC 2023


On Fri, 27 Oct 2023 13:10:07 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> Hi all,
>> 
>> please review this patch that makes the `INI` parser allow values to be updated _if_ they are set multiple times in a file. The below example would result in the key `name` having the value `jane`:
>> 
>> 
>> name=john
>> name=jane
>> 
>> 
>> Values in sections and sub-sections can now also be updated, the below example would result in the key `age` in the subsection `[person "john"]` having the value `47`:
>> 
>> 
>> [person]
>> age=0
>> 
>> [person "john"]
>> age=1
>> 
>> [person "john"]
>> age=47
>> 
>> 
>> This is in line with how Git's INI parser is working, see the following example:
>> 
>> 
>> $ printf '[test]\nfoo=bar\n' >> .git/config
>> $ printf '[test]\nfoo=baz\n' >> .git/config
>> $ cat .git/config
>> [test]
>> foo=bar
>> [test]
>> foo=baz
>> $ git config test.foo
>> baz
>> 
>> 
>> Enabling keys to be updated makes modifying just a single key in a `.jcheck/conf` easier. Appending the following to any `.jcheck/conf` would make merge commits requiring reviews:
>> 
>> 
>> [checks "reviewer"]
>> merge=check
>> 
>> 
>> This property will be used to simplify [AdditionalConfiguration](https://github.com/openjdk/skara/blob/master/bots/pr/src/main/java/org/openjdk/skara/bots/pr/AdditionalConfiguration.java) in an upcoming PR.
>> 
>> Thanks,
>> Erik
>
> Marked as reviewed by erikj (Lead).

Thanks for reviewing @erikj79 !

-------------

PR Comment: https://git.openjdk.org/skara/pull/1577#issuecomment-1782898174


More information about the skara-dev mailing list