git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Merge-friendly text-based data storage

From
HHHolger Hellmuth <hellmuth@ira.uka.de>
Date
Mar 27, 2012, 09:12 UTC
Message-ID
<4F718496.4030808@ira.uka.de>
In-Reply-To
<CAD77+gRTv4Aq_4FLAQcD9E0p7VBD7h6hQq3CJ9Wo5DU9Zjt+Hg@mail.gmail.com>
On 26.03.2012 16:19, Richard Hartmann wrote:
Show 17 quoted lines
> 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.

I may be misunderstanding something, but lets assume you want to merge a file that has "version: 0" with one that has "version: 1" and their last common ancestor would have "version: 0" naturally. So the merge would not fail even though the file layout changes.

And there would be random merge failures with lines added at the same line number even if different.

The normal merging in git isn't suited for this task, it has different objectives. Without a custom merge driver as Junio suggested the only way would be to store each data line in its own file. As you store file paths that would even fit, but I doubt it is what you had in mind

Previous: Junio C HamanoNext: Richard Hartmann
Message 5 of 8 in “Merge-friendly text-based data storage”
  1. Richard HartmannMar 26, 2012
  2. Junio C HamanoMar 26, 2012
  3. Richard HartmannMar 26, 2012
  4. Junio C HamanoMar 26, 2012
  5. Holger HellmuthMar 27, 2012
  6. Richard HartmannMar 27, 2012
  7. Junio C HamanoMar 27, 2012
  8. Holger HellmuthMar 27, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.