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

Re: Merge-friendly text-based data storage

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 27, 2012, 15:21 UTC
Message-ID
<7vzkb2jchu.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAD77+gR=p+jhN5qNoRgjtQPHqgqrdtcSmqAy_4d0NUaqE6ZkVg@mail.gmail.com>
Richard Hartmann <richih.mailinglist@gmail.com> writes:
Show 9 quoted lines
> On Tue, Mar 27, 2012 at 11:12, Holger Hellmuth <hellmuth@ira.uka.de> wrote:
>
>> 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.
>
> Ugh, I did not consider that. I can't come up with a way, other than a
> custom merge driver, to prevent this. Am I correct?
You are the only judge to that statement: "I can't come up with...".

I can't either, but I know a custom ll-merge driver would work. It is designed for this kind of thing. It will know both version 0 and version 1 format, read from each and writes out the merged result in whatever format it wants to use.

Show 5 quoted lines
>> 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
>
> I considered this as well, but that's extremely expensive and wasteful.

And it does not solve anything. The "version" file may cleanly merge to a new version, and there is no way for the merge result of "version" file to affect the outcome of merges in other files.

Previous: Richard HartmannNext: Holger Hellmuth
Message 7 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.