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

Re: Prepare "git-merge-tree" for future work

From
Junio C Hamano <junkio@cox.net>
Date
Jun 30, 2006, 20:52 UTC
Message-ID
<7vbqsagyd0.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0606291925230.12404@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 7 quoted lines
> In contrast, the ones to diff_filespec I've never really used, and I did 
> not want to compare blob objects, I very much wanted to compare in-memory 
> buffers (_and_ potentially blobs).
>
> So if you can show an easy example of how to populate a set of filespec 
> pairs (not with blobs - with in-memory generated data) and insert them 
> onto the lists, that would be good.

Ah, I see. Your origin() function always returns a in-core buffer from an existing blob (or NULL if it is a new file) but result() returns either an existing blob resulting from the tree-level merge, or a 3-way content merge result that does not have an existing blob, and it is not obvious how to express the latter as a filespec (all other cases you can stuff the blob object name in the sha1[] member and if you choose to do the read_sha1_file() yourself store the result in data member or you can let diff_populate_filespec() read the data when diff machinery needs it).

I think a filespec that has 0{40} sha1, with data already populated and should_free/should_munmap members both set to false might work for the in-memory data but I haven't tried.

I'd take the hint, and I will (eventually) take a look at it if nobody beats me to it, but most likely not now, sorry.

Previous: Linus Torvalds
Message 5 of 5 in “Prepare "git-merge-tree" for future work”
  1. Linus TorvaldsJun 28, 2006
  2. Linus TorvaldsJun 28, 2006
  3. Junio C HamanoJun 30, 2006
  4. Linus TorvaldsJun 30, 2006
  5. Junio C HamanoJun 30, 2006

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.