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

RE: [Bug] data loss with cyclic alternates

From
Keller, Jacob E <jacob.e.keller@intel.com>
Date
Jul 14, 2014, 22:05 UTC
Message-ID
<02874ECE860811409154E81DA85FBB585719878B@ORSMSX115.amr.corp.intel.com>
In-Reply-To
<20140712055703.GA9655@sigill.intra.peff.net>
Show 31 quoted lines
> -----Original Message-----
> From: Jeff King [mailto:peff@peff.net]
> Sent: Friday, July 11, 2014 10:57 PM
> To: Keller, Jacob E
> Cc: gitster@pobox.com; dr.khong@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

Previous: Jeff KingNext: Ephrim Khong
Message 5 of 16 in “[Bug] data loss with cyclic alternates”
  1. Ephrim KhongJul 11, 2014
  2. Junio C HamanoJul 11, 2014
  3. Keller, Jacob EJul 11, 2014
  4. Jeff KingJul 12, 2014
  5. Keller, Jacob EJul 14, 2014
  6. Ephrim KhongJul 13, 2014
  7. sha1_file: do not add own object directory as alternateEphrim Khong, Jul 14, 2014
  8. Duy NguyenJul 14, 2014
  9. Ephrim KhongJul 14, 2014
  10. Johannes SixtJul 15, 2014
  11. sha1_file: do not add own object directory as alternateEphrim Khong, Jul 15, 2014
  12. Junio C HamanoJul 15, 2014
  13. Ephrim KhongJul 16, 2014
  14. Eric SunshineJul 15, 2014
  15. Junio C HamanoJul 15, 2014
  16. Ephrim KhongJul 16, 2014

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.