{"thread":{"id":"38645","subject":"gc.linkedobjectdir discussion","startedAt":"2015-02-24T21:56:55Z","lastAt":"2015-02-24T22:26:08Z","messageCount":2,"participants":["Will Entriken","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"256597","messageId":"CAFwrLX7AVbhbP-Ha3Vag+7o5a-8fSaQxxx+z0DRurdzY-pBwkQ@mail.gmail.com","threadId":"38645","inReplyTo":null,"subject":"gc.linkedobjectdir discussion","fromName":"Will Entriken","fromEmail":"fulldecent@gmail.com","sentAt":"2015-02-24T21:56:55Z","receivedAt":"2015-02-24T21:56:55Z","isPatch":false,"sender":{"key":"fulldecent@gmail.com","avatar":null},"body":"Hello,\n\nThis post presents an idea for storing git objects into a hard-linked\nshared directory which would allow performance gains and safety so\nthat users can set it and forget it.\n\nSETUP:\nUsers run `git config --global gc.linkedobjectdir ~/.gitsharedobjects`\n\nUSAGE - CACHE MISS:\nDuring a pull, git will look for the needed object in LINKEDOBJECTDIR,\nsimilar to how it looks in GIT_ALTERNATE_OBJECT_DIRECTORIES. If it is\nnot found, the object is received as normal and then hard linked into\nthe object store at LINKEDOBJECTDIR.\n\nUSAGE - CACHE HIT:\nDuring another pull or clone on a different working directory, git\nwill find the required object in LINKEDOBJECTDIR and hard link into\nthe active repo's object store.\n\nUSAGE - DELETING:\nWhenever deleting an object, git will stat the file to see to see if\nits link count is 2, if so, both copies are deleted.\n\nPERIODIC MAINTENANCE:\nPeriodically, git will check all objects in LINKEDOBJECTDIR for a link\ncount of 1 and delete such files. This will happen if a repository\nwith linking is deleted with `rm -rf`.\n\nThis feature would be a benefit to organizations which do lots of\ncloning (think Travis CI) or users that clone the same project\nmultiple times or have the same file used across different repos.\n\nPlease share your thoughts.\n\nThank you,\nWill\n"},{"id":"256602","messageId":"xmqqsidvosjj.fsf@gitster.dls.corp.google.com","threadId":"38645","inReplyTo":"CAFwrLX7AVbhbP-Ha3Vag+7o5a-8fSaQxxx+z0DRurdzY-pBwkQ@mail.gmail.com","subject":"Re: gc.linkedobjectdir discussion","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-02-24T22:26:08Z","receivedAt":"2015-02-24T22:26:08Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Will Entriken <fulldecent@gmail.com> writes:\n\n> USAGE - CACHE HIT:\n> During another pull or clone on a different working directory, git\n> will find the required object in LINKEDOBJECTDIR and hard link into\n> the active repo's object store.\n\nWhat happens when the necessary objects are in a packfile, mixed\nwith other objects that this repository does not need but may be\nnecessary for other repositories?\n\n> USAGE - DELETING:\n> Whenever deleting an object, git will stat the file to see to see if\n> its link count is 2, if so, both copies are deleted.\n\nThis is totally unworkable if you ever pack your repository.  And\npacking loose objects is a lot more efficient way to reduce your\ndisk footprint than sharing the object store among a handful of\nrepositories.\n"}]}