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

Re: [PATCH] commit-reach: do not parse and iterate minima

From
Taylor Blau <me@ttaylorr.com>
Date
Mar 24, 2022, 22:06 UTC
Message-ID
<YjzrZNQZ7cBIr+Kx@nand.local>
In-Reply-To
<34da1688-7d94-d54c-6b3a-3106d0f15380@github.com>
On Thu, Mar 24, 2022 at 11:27:34AM -0400, Derrick Stolee wrote:
Show 15 quoted lines
> > This sounds quite tricky.  In this case we may know which commit we
> > need to avoid (re)parsing to avoid the bug, but would it always be
> > the case?  It feels almost like we want to unparse the commit
> > objects when we clear the grafts information in the previous patch,
> > doesn't it?
>
> I agree that the adjustment to paint_down_to_common() is a bit too
> coupled to this scenario, when we should just trust our commits to
> be valid if they have been parsed. We should always be able to
> parse our parents.
>
> Finding this bug is interesting, but I agree with Junio that a
> better fix would be to "unparse" a commit when modifying its graft
> in any way. That will universally fix it for any potential future
> commit walks that might be hit due to future code changes.
I agree completely with you both.

This made me think of some of the difficulties we encountered back in ce16364e89 (commit.c: don't persist substituted parents when unshallowing, 2020-07-08), particularly:

    One way to fix this would be to reset the parsed object pool entirely
    (flushing the cache and thus preventing subsequent reads from modifying
    their parents) after unshallowing. That would produce a problem when
    callers have a now-stale reference to the old pool, and so this patch
    implements a different approach.

if I can recall back to when that patch was written, I think the issue was that dumping the entire set of parsed objects caused us to have stale references in the commit-graph machinery.

I'm not sure whether or not the same difficulties would be encountered here, though. The shallow stuff is so tricky to me...

Thanks, Taylor

Previous: Derrick StoleeNext: Derrick Stolee
Message 4 of 16 in “commit-reach: do not parse and iterate minima”
  1. commit-reach: do not parse and iterate minimaJonathan Tan, Mar 23, 2022
  2. Junio C HamanoMar 23, 2022
  3. Derrick StoleeMar 24, 2022
  4. Taylor BlauMar 24, 2022
  5. Derrick StoleeMar 25, 2022
  6. Jonathan TanMar 24, 2022
  7. Bagas SanjayaMar 24, 2022
  8. Jonathan TanMar 24, 2022
  9. Derrick StoleeMar 24, 2022
  10. Jonathan TanMar 24, 2022
  11. commit,shallow: unparse commits if grafts changedJonathan Tan, Jun 2, 2022
  12. Ævar Arnfjörð BjarmasonJun 3, 2022
  13. Derrick StoleeJun 3, 2022
  14. Jonathan TanJun 3, 2022
  15. Jonathan TanJun 3, 2022
  16. commit,shallow: unparse commits if grafts changedJonathan Tan, Jun 6, 2022

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.