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

Dealing with many many git repos in a /home directory

From
Ddemerphq <demerphq@gmail.com>
Date
Feb 4, 2010, 08:29 UTC
Message-ID
<9b18b3111002040029x1c7de0afw4a5ef883588f7a18@mail.gmail.com>

At $work we have a host where we have about 50-100 users each with their own private copies of the same repos. These are cloned froma remote via git/ssh and are not thus automatically hardlinking their object stores.

This is starting to take a lot of space.

I was thinking it should be possible to hardlink all of the objects in the different repos to a canonical single copy.

Would i be correct in thinking that if i have to repos with an equivalent .git/objects/../..... file in them that the files are necessarily identical and one can be replaced by a hardlink to the other?

If this is correct then is there some tool known to the list that already does this? I whipped this together:

find /home -regex .\*/.git/objects/.\* | perl -lne'if (m!(\.git/objects/../.+)!) { if (my $t= $seen{$1}) { link $t,$_ } else { $seen{$1}=$_ } }'

But a proper script with a sign off of some git dev would make me feel a lot safer :-)

cheers, Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"
Next: Alex Riesen
Message 1 of 6 in “Dealing with many many git repos in a /home directory”
  1. demerphqFeb 4, 2010
  2. Alex RiesenFeb 4, 2010
  3. SergioFeb 4, 2010
  4. Martin LanghoffFeb 4, 2010
  5. Andreas SchwabFeb 4, 2010
  6. Nicolas PitreFeb 4, 2010

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.