4 ms·
Loosely running with your example: A file already exists with this content: [{"cmd": "git checkout", "when": 1234 }] Another tool wants to add a setting/elem
by mjevans 7y ago
Loosely running with your example:
A file already exists with this content:
[{"cmd": "git checkout", "when": 1234 }]
Another tool wants to add a setting/element/etc, and simply creates a new config object with only the change in question included and APPENDS the existing config.
[{"cmd": "git checkout", "when": 1234 }][{"cmd": "vagrant up", "when": 4567},{"comment": "Comments, notes, etc are kept even if they don't validate to the recognized configuration options."}]
A configuration validator / etc loads the config and merges these in state-machine order, over-writing existing values with the latest ones from the end of the stream of objects and then determining if the result is a valid configuration. (Maybe file references fail to resolve / don't open / there's some combination of settings that's not supported...)
[
{"cmd": "git checkout", "when": 1234 },
{"cmd": "vagrant up", "when": 4567},
{"comment": "... actually kept as above"}
]