RFR: 2080: ini: allow values to be updated

Erik Duveblad ehelin at openjdk.org
Fri Oct 27 08:16:45 UTC 2023


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

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

Commit messages:
 - 2080

Changes: https://git.openjdk.org/skara/pull/1577/files
 Webrev: https://webrevs.openjdk.org/?repo=skara&pr=1577&range=00
  Issue: https://bugs.openjdk.org/browse/SKARA-2080
  Stats: 60 lines in 2 files changed: 44 ins; 9 del; 7 mod
  Patch: https://git.openjdk.org/skara/pull/1577.diff
  Fetch: git fetch https://git.openjdk.org/skara.git pull/1577/head:pull/1577

PR: https://git.openjdk.org/skara/pull/1577


More information about the skara-dev mailing list