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

Re: Why pack+unpack?

From
Junio C Hamano <junkio@cox.net>
Date
Jul 26, 2005, 06:14 UTC
Message-ID
<7vek9mayar.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0507252145470.6074@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> See? Trying to have one really solid code-path is not a waste of time. 

An alternative code path specialized for local case would not be too bad.

First, finding the list of objects to copy. You can use alternate object pool to cover the upstream repository to pull from, and the downstream repository to pull into (both local), run rev-list --objects, giving it prefix '^' for all refs in the downstream repository, and the upstream head SHA1 you are pulling. If the upstream head you are pulling is a tag, then you may need to dereference it as well.

Among those objects, ones unpacked in the upstream can be copied/linked to the downstream repository.

Handling packs involves a little bit of policy decision. The current pack/unpack way always unpacks, and to emulate it, we can cat-file in the upstream object database, pipe that to "hash-object -w" (after giving hash-object an option to read from the standard input) to write in the downstream repository unpacked. Easier alternative is to just hardlink all the packs from the upstream object database into the downstream object database, and keep packed things packed.

Well, it starts to sound somewhat bad...
Previous: Linus Torvalds
Message 5 of 5 in “Kernel Hacker's guide to git (updated)”
  1. Jeff GarzikJul 15, 2005
  2. Linus TorvaldsJul 26, 2005
  3. Jeff GarzikJul 26, 2005
  4. Linus TorvaldsJul 26, 2005
  5. Junio C HamanoJul 26, 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.