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

Re: [PATCH 3/4] mark_reachable_objects(): optionally collect broken refs

From
Jeff King <peff@peff.net>
Date
Sep 24, 2015, 17:56 UTC
Message-ID
<20150924175615.GA15117@sigill.intra.peff.net>
In-Reply-To
<bcceeae4c8f7f690502651dd6cc537b2f4918fac.1443085919.git.johannes.schindelin@gmx.de>
On Thu, Sep 24, 2015 at 11:13:52AM +0200, Johannes Schindelin wrote:
Show 6 quoted lines
> The behavior of `mark_reachable_objects()` without this patch is that it
> dies if it encounters a broken ref. This is sometimes undesirable, e.g.
> when garbage collecting in a repository with a stale remote HEAD.
> 
> So let's introduce an optional parameter to collect such broken refs. The
> behavior of the function is unchanged if that parameter is `NULL`.
Similar comment to the last one. :)

I suspect the issues you are seeing are largely new due to the ref-paranoia work I did (merged in 05e816e37). We used to ignore broken refs at the for_each_ref() level, but now we feed them to the calling code (which generally chokes).

So in that sense, a simpler fix than your series would be to simply revert 8d42299 and ff4056bbc. :)

But I think those new checks are valuable, and we really just need to gracefully ignore the dangling-symref case (which is _a_ breakage, but not a dangerous one).

-Peff
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 6 of 28 in “Fix gc failure when a remote HEAD goes stale”
  1. 0/4 Fix gc failure when a remote HEAD goes staleJohannes Schindelin, Sep 24, 2015
  2. 1/4 gc: demonstrate failure with stale remote HEADJohannes Schindelin, Sep 24, 2015
  3. 2/4 pack-objects: do not get distracted by stale refsJohannes Schindelin, Sep 24, 2015
  4. Jeff KingSep 24, 2015
  5. 3/4 mark_reachable_objects(): optionally collect broken refsJohannes Schindelin, Sep 24, 2015
  6. Jeff KingSep 24, 2015
  7. 4/4 gc: remove broken refsJohannes Schindelin, Sep 24, 2015
  8. Jeff KingSep 24, 2015
  9. Junio C HamanoSep 25, 2015
  10. Jeff KingSep 25, 2015
  11. 0/4 Fix gc failure when a remote HEAD goes staleJohannes Schindelin, Sep 28, 2015
  12. 1/4 gc: demonstrate failure with stale remote HEADJohannes Schindelin, Sep 28, 2015
  13. 2/4 pack-objects: do not get distracted by broken symrefsJohannes Schindelin, Sep 28, 2015
  14. 3/4 mark_reachable_objects(): optionally collect broken symrefsJohannes Schindelin, Sep 28, 2015
  15. 4/4 gc: remove broken symrefsJohannes Schindelin, Sep 28, 2015
  16. Junio C HamanoSep 28, 2015
  17. Junio C HamanoSep 28, 2015
  18. Johannes SchindelinSep 28, 2015
  19. Junio C HamanoOct 5, 2015
  20. Jeff KingSep 28, 2015
  21. Johannes SchindelinSep 28, 2015
  22. 0/2 Fix gc failure when a remote HEAD goes staleJohannes Schindelin, Oct 6, 2015
  23. 1/2 gc: demonstrate failure with stale remote HEADJohannes Schindelin, Oct 6, 2015
  24. 2/2 pack-objects: do not get distracted by broken symrefsJohannes Schindelin, Oct 6, 2015
  25. Junio C HamanoOct 7, 2015
  26. Johannes SchindelinOct 8, 2015
  27. Junio C HamanoOct 8, 2015
  28. Johannes SchindelinOct 8, 2015

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.