Merge-friendly text-based data storage
- From
Richard Hartmann <richih.mailinglist@gmail.com>
- Date
- Mar 26, 2012, 14:19 UTC
- Message-ID
- <CAD77+gRTv4Aq_4FLAQcD9E0p7VBD7h6hQq3CJ9Wo5DU9Zjt+Hg@mail.gmail.com>
Hi all,
I am looking for information on how to design a merge-friendly data layout. Oddly enough, there does not seem to be much online other than the obvious "use text-based lines, one per data point".
My current plan looks like:
metamonger\tversion: 0 filename\towner_name\tgroup_name\tetc\tpp ########## file1\trichih\trichih\tfoo\tbar relative/path/to/file2\troot\troot\tfoo\tbar
the two upper lines are designed to fail a merge if the version of the file layout changes. Anything starting with a hash-pound is a comment and will be ignored.
All other lines are data about random files, relative paths being allowed, absolute paths and upper paths being forbidden for security reasons. Values are tab-separated as the format is expressively meant to be edited by hand. Hex, if needed, would be ASCII-armoured.
As long as there are no lines that start with the same file name, this file format would allow for efficient merging _if_ git has an internal concept of line identifiers.
Are there any considerations I missed? Are there any design guides/best practices to follow?
Thanks, Richard