{"thread":{"id":"26041","subject":"Splitting a repository but sharing the common parts of the object database","startedAt":"2010-12-13T18:39:47Z","lastAt":"2010-12-13T23:25:08Z","messageCount":5,"participants":["Phillip Susi","Jonathan Nieder","Stephen Bash"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"157984","messageId":"4D066873.4020208@cfl.rr.com","threadId":"26041","inReplyTo":null,"subject":"Splitting a repository but sharing the common parts of the object database","fromName":"Phillip Susi","fromEmail":"psusi@cfl.rr.com","sentAt":"2010-12-13T18:39:47Z","receivedAt":"2010-12-13T18:39:47Z","isPatch":false,"sender":{"key":"psusi@cfl.rr.com","avatar":null},"body":"I have recently started a new project that has begun its life as a fork\nof an old project, then heavily modified.  At the same time I am looking\ninto migrating from svn to git.  Since this is a separate project, I\nthought I should split it into a separate git repository and keep them\nseparate going forward, however, since they have common ancestry up to\nthis point, I would like to make sure that all of that data is not\nduplicated.\n\nI thought what I could do is set up an initial repository that is fully\npacked and use it as a read only archive to contain all of the shared\nhistory, then clone that into two new repositories for the two separate\nprojects.  It seems like I can do this by running a clone -s so that the\narchive is set up to be an alternate object store, then its big pack\nfile will be found and used for all of the old history, but new commits\nwill be specific to each of the two new respective projects.  The\nproblem I run into though, is when it comes time to repack the new projects.\n\nIf I run a repack -a, then the new project has everything copied out of\nthe archive and into its new main pack, rather than continuing to use\nthe archive repository for old history, and just pack everything since\nthen.  I guess I am looking for is somewhere between a full repack and\nan incremental; a way to make repack -a discard existing local packs,\nbut to respect the alternate packs and omit objects they contain from\nthe new local pack.  Is this possible?\n"},{"id":"157988","messageId":"20101213192053.GA30315@burratino","threadId":"26041","inReplyTo":"4D066873.4020208@cfl.rr.com","subject":"Re: Splitting a repository but sharing the common parts of the object database","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-12-13T19:20:53Z","receivedAt":"2010-12-13T19:20:53Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Phillip,\n\nPhillip Susi wrote:\n\n> If I run a repack -a, then the new project has everything copied out of\n> the archive and into its new main pack, rather than continuing to use\n> the archive repository for old history, and just pack everything since\n> then.  I guess I am looking for is somewhere between a full repack and\n> an incremental; a way to make repack -a discard existing local packs,\n> but to respect the alternate packs and omit objects they contain from\n> the new local pack.\n\nYou might be interested in girocco's fork support.  See\nhttp://repo.or.cz/w/girocco.git/blob/HEAD:/jobd/gc.sh for starters.\n\n(Yes, the short answer is \"-l\" but showing where I got that answer\nfrom seems a little easier. :))\n"},{"id":"157992","messageId":"31673515.186200.1292269850925.JavaMail.root@mail.hq.genarts.com","threadId":"26041","inReplyTo":"20101213192053.GA30315@burratino","subject":"Re: Splitting a repository but sharing the common parts of the object database","fromName":"Stephen Bash","fromEmail":"bash@genarts.com","sentAt":"2010-12-13T19:50:50Z","receivedAt":"2010-12-13T19:50:50Z","isPatch":false,"sender":{"key":"bash@genarts.com","avatar":null},"body":"----- Original Message -----\n> From: \"Jonathan Nieder\" <jrnieder@gmail.com>\n> To: \"Phillip Susi\" <psusi@cfl.rr.com>\n> Cc: git@vger.kernel.org\n> Sent: Monday, December 13, 2010 2:20:53 PM\n> Subject: Re: Splitting a repository but sharing the common parts of the object database\n> Hi Phillip,\n> \n> Phillip Susi wrote:\n> \n> > If I run a repack -a, then the new project has everything copied out\n> > of the archive and into its new main pack, rather than continuing to\n> > use the archive repository for old history, and just pack everything\n> > since then. I guess I am looking for is somewhere between a full repack\n> > and an incremental; a way to make repack -a discard existing local\n> > packs, but to respect the alternate packs and omit objects they contain\n> > from the new local pack.\n> \n> You might be interested in girocco's fork support. See\n> http://repo.or.cz/w/girocco.git/blob/HEAD:/jobd/gc.sh for starters.\n\nYou might also be interested in Pro Git's entry on git-replace:\n\n  http://progit.org/2010/03/17/replace.html\n\nIt's a completely different approach than what you're suggesting, but might open up new and interesting avenues.\n\nStephen\n"},{"id":"158008","messageId":"4D06A98B.1060408@cfl.rr.com","threadId":"26041","inReplyTo":"20101213192053.GA30315@burratino","subject":"Re: Splitting a repository but sharing the common parts of the object database","fromName":"Phillip Susi","fromEmail":"psusi@cfl.rr.com","sentAt":"2010-12-13T23:17:31Z","receivedAt":"2010-12-13T23:17:31Z","isPatch":false,"sender":{"key":"psusi@cfl.rr.com","avatar":null},"body":"On 12/13/2010 02:20 PM, Jonathan Nieder wrote:\n> You might be interested in girocco's fork support.  See\n> http://repo.or.cz/w/girocco.git/blob/HEAD:/jobd/gc.sh for starters.\n>\n> (Yes, the short answer is \"-l\" but showing where I got that answer\n> from seems a little easier. :))\n\nYes, -l looks like exactly what I need.  Now I don't suppose there is a \nway to make it sticky so I don't have to remember to use it when \nrepacking every time?  :)\n\nI checked the man page for git-config and it doesn't show an option that \nsounds like it.\n"},{"id":"158009","messageId":"20101213232508.GB32103@burratino","threadId":"26041","inReplyTo":"4D06A98B.1060408@cfl.rr.com","subject":"Re: Splitting a repository but sharing the common parts of the object database","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-12-13T23:25:08Z","receivedAt":"2010-12-13T23:25:08Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Phillip Susi wrote:\n\n> Yes, -l looks like exactly what I need.  Now I don't suppose there\n> is a way to make it sticky so I don't have to remember to use it\n> when repacking every time?  :)\n\nMaybe\n\n\t[alias \"repackfork\"]\n\t\trepack -a -d -f -l ...whatever other options are wanted...\n"}]}