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

Re: [PATCH] Make object contents optionally available

From
Daniel Barkalow <barkalow@iabervon.org>
Date
May 17, 2005, 19:59 UTC
Message-ID
<Pine.LNX.4.21.0505171535510.30848-100000@iabervon.org>
In-Reply-To
<7vbr79fy22.fsf@assigned-by-dhcp.cox.net>
On Tue, 17 May 2005, Junio C Hamano wrote:
> That's what I meant to say by "types are special" but I phrased it so
> badly.

Ah, okay. I'm not convinced that discriminating at all at the point where parse is deciding whether to free the contents is that useful; doing it based on type is just sufficiently easy that it could be worthwhile.

> And the callback would solve that naturally.  Or you can
> additionally give the callback the result of the parse_xxx(),
> which would be even more useful.  The callback can then throw
> commit raw-data away based on the date, for example.

I don't think a callback has any advantage over turning on a flag to provide all unpacked objects, and having the program free them when it wants to, either right after whatever caused them to be parsed returns or later. I suspect that the main relevant thing is going to be the stack, not the data.

I have another idea, which is almost certainly too magical, but which would work: have library functions that parse objects return them unpacked if the objects they are given are unpacked. So, for example, pop_most_recent_commit() would unpack parents of a commit if the commit was unpacked. This would make everything work the way you'd expect if you didn't think about it, although it would probably be really surprising if you were thinking about it. I'm just mentioning this because it might make someone think of something similar but sane.

	-Daniel
*This .sig left intentionally blank*
Previous: Junio C Hamano
Message 7 of 7 in “Make object contents optionally available”
  1. Make object contents optionally availableDaniel Barkalow, May 17, 2005
  2. Linus TorvaldsMay 17, 2005
  3. Daniel BarkalowMay 17, 2005
  4. Junio C HamanoMay 17, 2005
  5. Daniel BarkalowMay 17, 2005
  6. Junio C HamanoMay 17, 2005
  7. Daniel BarkalowMay 17, 2005

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.