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

Re: CAREFUL! No more delta object support!

From
Linus Torvalds <torvalds@osdl.org>
Date
Jun 29, 2005, 03:53 UTC
Message-ID
<Pine.LNX.4.58.0506282041360.19755@ppc970.osdl.org>
In-Reply-To
<Pine.LNX.4.58.0506281111480.19755@ppc970.osdl.org>
On Tue, 28 Jun 2005, Linus Torvalds wrote:
Show 8 quoted lines
> 
> >						 I'm not sure I
> > want to write the "parse incoming pack-file" thing, but git-unpack-objects
> > comes _reasonably_ close (but right now it seeks around using the index
> > file to resolve deltas, instead of keeping them in memory and resolving
> > them when possible).
> 
> I'm still thinking about this one. I think I'll just do it.

Ok, done. I had to basically rewrite that unpacking logic, but the end result is actually slightly smaller and cleaner, and it can now unpack from a stream. That stream reading logic that uncompresses directly from the stream buffer might be considered a bit too subtle (and somebody should really double-check it), but hey, it works for me.

In fact, I just did this:
	#
	# Create empty git archive "~/unpack"	
	#
	mkdir ~/unpack
	cd ~/unpack
	git-init-db
	#
	# Copy the git archive there over a pipe
	#
	cd ~/git
	git-rev-list --objects HEAD | git-pack-objects --depth=50 --window=50 --stdout | (cd ~/unpack ; git-unpack-objects)
	#
	# Go to new archive, set up the head, and fsck to verify
	#
	cd ~/unpack
	cat ~/git/.git/HEAD > .git/HEAD 
	git-fsck-cache --unreachable

Now, the above is a silly example, since I _could_ just have moved the pack file into .git/objects/pack, but that was not the point of this whole thing. The point was to do what a "git-ssh-push" would basically boil down to.

I'd like somebody who knows zlib intimately to take a look at how I do the streaming input thing (in particular, the "use(len - stream.avail_in);" part in the inflate loop in the "get_data()" function).

			Linus
Previous: Daniel BarkalowNext: Linus Torvalds
Message 31 of 38 in “CAREFUL! No more delta object support!”
  1. Linus TorvaldsJun 28, 2005
  2. Christopher LiJun 27, 2005
  3. Linus TorvaldsJun 28, 2005
  4. Junio C HamanoJun 28, 2005
  5. Christopher LiJun 28, 2005
  6. Petr BaudisJun 28, 2005
  7. Benjamin LaHaiseJun 28, 2005
  8. Petr BaudisJun 28, 2005
  9. Jan HarkesJun 28, 2005
  10. Christopher LiJun 28, 2005
  11. Linus TorvaldsJun 28, 2005
  12. Emit base objects of a delta chain when the delta is output.Junio C Hamano, Jun 29, 2005
  13. Junio C HamanoJun 28, 2005
  14. Skip writing out sha1 files for objects in packed git.Junio C Hamano, Jun 28, 2005
  15. Linus TorvaldsJun 28, 2005
  16. Junio C HamanoJun 28, 2005
  17. Linus TorvaldsJun 28, 2005
  18. Linus TorvaldsJun 28, 2005
  19. Junio C HamanoJun 28, 2005
  20. Adjust to git-init-db creating $GIT_OBJECT_DIRECTORY/packJunio C Hamano, Jun 28, 2005
  21. Linus TorvaldsJun 28, 2005
  22. Daniel BarkalowJun 28, 2005
  23. Linus TorvaldsJun 28, 2005
  24. Linus TorvaldsJun 28, 2005
  25. Daniel BarkalowJun 28, 2005
  26. Linus TorvaldsJun 28, 2005
  27. Linus TorvaldsJun 28, 2005
  28. Matthias UrlichsJun 28, 2005
  29. Matthias UrlichsJun 28, 2005
  30. Daniel BarkalowJun 28, 2005
  31. Linus TorvaldsJun 29, 2005
  32. Linus TorvaldsJun 29, 2005
  33. Daniel BarkalowJun 29, 2005
  34. Linus TorvaldsJun 29, 2005
  35. Daniel BarkalowJun 29, 2005
  36. Adjust fsck-cache to packed GIT and alternate object pool.Junio C Hamano, Jun 28, 2005
  37. Expose packed_git and alt_odb.Junio C Hamano, Jun 28, 2005
  38. 3/3 Update fsck-cache (take 2)Junio C Hamano, Jun 28, 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.