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

Re: [PATCH] Add '--create-index' to git-unpack-objects

From
Sergey Vlasov <vsu@altlinux.ru>
Date
Oct 12, 2005, 14:55 UTC
Message-ID
<20051012145548.GA2539@master.mivlgu.local>
In-Reply-To
<Pine.LNX.4.63.0510121612340.6307@wbgn013.biozentrum.uni-wuerzburg.de>
On Wed, Oct 12, 2005 at 04:25:22PM +0200, Johannes Schindelin wrote:
Show 5 quoted lines
> On Wed, 12 Oct 2005, Sergey Vlasov wrote:
> > Saving unpacked objects in memory would obviously be unacceptable.
> 
> Actually, this is what git-unpack-objects does. All unresolved deltas are 
> stored in a linked list, and handled later.

Yes, this may be a problem if the pack is large and contains many deltas. But these stored deltas are thrown away immediately when the base object is found; if you want to implement a streaming reindex, you will need to store them until you reach the end of pack (or write those objects to some temporary files).

Show 5 quoted lines
> Of course, it would be nicer to use a seekable file if you have one. But 
> then, I am not at all sure that base objects should be allowed to come 
> later in the file: since the delta chains must not be cyclic, the objects
> can be sorted. Thus, it could be guaranteed that the base objects are 
> already unpacked when unpacking the derived object.

Hmm, pack-objects.c:write_one() does exactly the opposite - it writes the base object _after_ writing out the delta (but it does not ensure that ordering completely, so references to base objects can be pointing in both directions). Why?

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 10 of 12 in “Add '--create-index' to git-unpack-objects”
  1. Add '--create-index' to git-unpack-objectsJohannes Schindelin, Oct 12, 2005
  2. Sergey VlasovOct 12, 2005
  3. Add git-index-pack utilitySergey Vlasov, Oct 12, 2005
  4. Johannes SchindelinOct 12, 2005
  5. Sergey VlasovOct 12, 2005
  6. Fix packname hash generation.Junio C Hamano, Oct 12, 2005
  7. clone-pack: new option --keep to keep the pack unexploded.Junio C Hamano, Oct 13, 2005
  8. Junio C HamanoOct 13, 2005
  9. Johannes SchindelinOct 12, 2005
  10. Sergey VlasovOct 12, 2005
  11. Johannes SchindelinOct 12, 2005
  12. Linus TorvaldsOct 12, 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.