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

sharing object packs

From
Mmarc.zonzon+git@gmail.com <marc.zonzon+git@gmail.com>
Date
Jun 18, 2008, 19:57 UTC
Message-ID
<20080618195726.GA20440@kernoel.dyndns.org>
Hello

I have a big bare repository 'main.git' and many small git repositories sub1, sub2, ... subn. All repositories lie in the same file file system, and each subx repository track and fetch main.git in a remote branch.

I would like to avoid duplicating main.git objects, I have made some tries:
- Putting a hard link to the pack in the object repository of main.git into subx object repository before fetching the main.git remote. 
It works well... until the first repack on either side. 
Note that the problem is the same for any clone of a local repository, the hard link of packs vanish on the first repack. 
You end up with a pack with the same objects, and so the same name, but organized in a different way so with an associated idx file and often a different file size.
- Using an objects/info/alternates with the path of main.git object repository.
It work well too, but I import objects from main.git inside subx, and they don't have the same life time than those in main.git. So they can, disapear during a git-prune-packed or gc. (The same problem we have with: git clone --share)
- I tried also to use git-relink to synchronize diverging repositories. But git-relink see different packs with the same name, (because repacked in a different way) and refuse to hard-link the packs but hard-links the .idx which has also an identical name and had the same size in my experiments.
So the .idx does no longer agree with the .pack and git fsck fail. Of course we can recover the repository by generating a new idx, but git-relink is a dangerous tool to use here.

If we unpack all objects we have not all these problems, but the main.git is in this case quite big. Of course it may be better to have a big repository than 20 copies of the packed repository. But I suppose that that there is some way to share an object repository in a safe way, even if it includes some packs.

I am quite new to git core and internals, so I may have missed the point.
Marc
Next: Shawn O. Pearce
Message 1 of 3 in “sharing object packs”
  1. marc.zonzon+git@gmail.comJun 18, 2008
  2. Shawn O. PearceJun 19, 2008
  3. marc zonzonJun 19, 2008

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.