> -----Original Message-----
> From: Jeff King [mailto:p...@peff.net]
> Sent: Friday, July 11, 2014 10:57 PM
> To: Keller, Jacob E
> Cc: gits...@pobox.com; dr.kh...@gmail.com; git@vger.kernel.org
> Subject: Re: [Bug] data loss with cyclic alternates
> 
> On Fri, Jul 11, 2014 at 06:01:46PM +0000, Keller, Jacob E wrote:
> 
> > > Yeah, don't do that.  A thinks "eh, the other guy must have it" and
> > > B thinks the same.  In general, do not prune or gc a repository
> > > other repositories borrow from, even if there is no cycle, because
> > > the borrowee does not know anythning about objects that it itself no
> > > longer needs but are still needed by its borrowers.
> > >
> >
> > Doesn't gc get run automatically at some points? Is the automatic gc run
> > setup to avoid this problem?
> 
> No, the automatic gc doesn't avoid this. It can't in the general case,
> as the parent repository does not know how many or which children are
> pointed to it as an alternate. And the borrowing repository does not
> even need to have write permission to the parent, so it cannot write a
> backpointer.
> 
> If people are using alternates, they should probably turn off gc.auto in
> the borrowee (it doesn't seem unreasonable to me to do so automatically
> via "clone -s" in cases where we can write to the alternates repo, and
> to issue a warning otherwise).
> 
> -Peff

Yes, if this is a known problem and we can avoid it by disabling garbage 
collection, that makes sense to me to do so..

Thanks,
Jake

Reply via email to