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

gc.linkedobjectdir discussion

From
WEWill Entriken <fulldecent@gmail.com>
Date
Feb 24, 2015, 21:56 UTC
Message-ID
<CAFwrLX7AVbhbP-Ha3Vag+7o5a-8fSaQxxx+z0DRurdzY-pBwkQ@mail.gmail.com>
Hello,

This post presents an idea for storing git objects into a hard-linked shared directory which would allow performance gains and safety so that users can set it and forget it.

SETUP: Users run `git config --global gc.linkedobjectdir ~/.gitsharedobjects`

USAGE - CACHE MISS: During a pull, git will look for the needed object in LINKEDOBJECTDIR, similar to how it looks in GIT_ALTERNATE_OBJECT_DIRECTORIES. If it is not found, the object is received as normal and then hard linked into the object store at LINKEDOBJECTDIR.

USAGE - CACHE HIT: During another pull or clone on a different working directory, git will find the required object in LINKEDOBJECTDIR and hard link into the active repo's object store.

USAGE - DELETING: Whenever deleting an object, git will stat the file to see to see if its link count is 2, if so, both copies are deleted.

PERIODIC MAINTENANCE: Periodically, git will check all objects in LINKEDOBJECTDIR for a link count of 1 and delete such files. This will happen if a repository with linking is deleted with `rm -rf`.

This feature would be a benefit to organizations which do lots of cloning (think Travis CI) or users that clone the same project multiple times or have the same file used across different repos.

Please share your thoughts.

Thank you, Will

Next: Junio C Hamano
Message 1 of 2 in “gc.linkedobjectdir discussion”
  1. Will EntrikenFeb 24, 2015
  2. Junio C HamanoFeb 24, 2015

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.