{"thread":{"id":"30548","subject":"Local cache for git objects","startedAt":"2012-05-17T20:06:51Z","lastAt":"2012-05-17T21:11:47Z","messageCount":4,"participants":["Bartosz Gęza","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"191634","messageId":"CALnNMuHdNFktUkp+Vdc=ooTJ9ay_BJftAJ_toVaBDA5EOzt9ww@mail.gmail.com","threadId":"30548","inReplyTo":null,"subject":"Local cache for git objects","fromName":"Bartosz Gęza","fromEmail":"bartoszgeza@gmail.com","sentAt":"2012-05-17T20:06:51Z","receivedAt":"2012-05-17T20:06:51Z","isPatch":false,"sender":{"key":"bartoszgeza@gmail.com","avatar":null},"body":"I'd like to speed up fetching objects from remote repositiories when creating\nmultiple clones on one or more machines in LAN.\n\nI know it can be done by hand: git-fetch once and git-clone from local copy.\nI think about adding new capability to upload-pack which would allow making\nrelay and object store. Client would supply url where \"want\"-ed objects should\nbe available.\n\nNext I'd add config option for git-fetch with url of this cache.\nfetch-pack would get refs from remote and request objects from cache.\n\nI'm not sure if this hasn't been done.\nWould such feature be included in git?\n"},{"id":"191635","messageId":"CALnNMuE=YQsXK-kiRUntNU_0s7s6ONgBk92dZN4UD0Va+qqF+Q@mail.gmail.com","threadId":"30548","inReplyTo":"1337285744-ner-2739@calvin","subject":"Re: Local cache for git objects","fromName":"Bartosz Gęza","fromEmail":"bartoszgeza@gmail.com","sentAt":"2012-05-17T20:36:37Z","receivedAt":"2012-05-17T20:36:37Z","isPatch":false,"sender":{"key":"bartoszgeza@gmail.com","avatar":null},"body":"On Thu, May 17, 2012 at 10:15 PM, Tomas Carnecky\n<tomas.carnecky@gmail.com> wrote:\n> On Thu, 17 May 2012 22:06:51 +0200, Bartosz Gęza <bartoszgeza@gmail.com> wrote:\n>> I'd like to speed up fetching objects from remote repositiories when creating\n>> multiple clones on one or more machines in LAN.\n> Does git clone --reference do what you want?\n\nI didn't know about --reference, but that's not it.\nI've tried it just now:\n\n$ git init --bare reference.git\nInitialized empty Git repository in /.../reference.git\n$ git clone --reference ./reference.git/ git://someurl/foo.git foo\nCloning into 'foo'...\n[...] (fetches whole pack)\n$ git clone --reference ./reference.git/ git://someurl/foo.git foo2\nCloning into 'foo2'...\n[...] (fetches whole pack again)\n\nReference is read only (?)\nI'd like to set up one global cache repository and forget.\nLater as I fetch any objects they are stored there for fast future access.\n"},{"id":"191636","messageId":"xmqqk40a7cwi.fsf@junio.mtv.corp.google.com","threadId":"30548","inReplyTo":"CALnNMuE=YQsXK-kiRUntNU_0s7s6ONgBk92dZN4UD0Va+qqF+Q@mail.gmail.com","subject":"Re: Local cache for git objects","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-05-17T20:47:41Z","receivedAt":"2012-05-17T20:47:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bartosz Gęza <bartoszgeza@gmail.com> writes:\n\n> Reference is read only (?)\n> I'd like to set up one global cache repository and forget.\n> Later as I fetch any objects they are stored there for fast future access.\n\nSomebody needs to keep the \"global cache\" up to date, and that has to be\nsomebody who has access to cron(7) on your system, and you will be a\ngood candidate to do so.  So as part of the procedure to \"set up one\nglobal cache repository and forget (about it)\", make a bare clone and\nthen set up a scheduled task to periodically \"git fetch\" from its\norigin, and then you are pretty much done, no?\n"},{"id":"191637","messageId":"CALnNMuFtp0CoMkiP0W+6bOmd4Y6JD2b5HZuc3qfAuxiJjTcwEA@mail.gmail.com","threadId":"30548","inReplyTo":"xmqqk40a7cwi.fsf@junio.mtv.corp.google.com","subject":"Re: Local cache for git objects","fromName":"Bartosz Gęza","fromEmail":"bartoszgeza@gmail.com","sentAt":"2012-05-17T21:11:47Z","receivedAt":"2012-05-17T21:11:47Z","isPatch":false,"sender":{"key":"bartoszgeza@gmail.com","avatar":null},"body":"On Thu, May 17, 2012 at 10:47 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Bartosz Gęza <bartoszgeza@gmail.com> writes:\n>\n> > Reference is read only (?)\n> > I'd like to set up one global cache repository and forget.\n> > Later as I fetch any objects they are stored there for fast future\n> > access.\n>\n> Somebody needs to keep the \"global cache\" up to date, and that has to be\n> somebody who has access to cron(7) on your system, and you will be a\n> good candidate to do so.  So as part of the procedure to \"set up one\n> global cache repository and forget (about it)\", make a bare clone and\n> then set up a scheduled task to periodically \"git fetch\" from its\n> origin, and then you are pretty much done, no?\n\nThat would work. It's a good practice for a single project with stable\ndependencies.\n\nMy only concern is that it requires effort from user of the cache to\nkeep the list of tracked remotes up to date. After time user would\nhave to recall how to update the list or bother somebody who\nremembers. I suppose that in a few months since set up it would only\ninclude repositories that take over 5-10 minutes to fetch.\n"}]}