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

Re: [RFC PATCH 0/1] commit-graph.c: handle corrupt commit trees

From
GSGarima Singh <garimasigit@gmail.com>
Date
Sep 4, 2019, 18:25 UTC
Message-ID
<c5ba4eaa-f995-5f2e-4f0f-a8f59ba65fd3@gmail.com>
In-Reply-To
<cover.1567563244.git.me@ttaylorr.com>
On 9/3/2019 10:22 PM, Taylor Blau wrote:
Show 13 quoted lines
> Hi,
> 
> I was running some of the new 'git commit-graph' commands, and noticed
> that I could consistently get 'git commit-graph write --reachable' to
> segfault when a commit's root tree is corrupt.
> 
> I have an extremely-unfinished fix attached as an RFC PATCH below, but I
> wanted to get a few thoughts on this before sending it out as a non-RFC.
> 
> In my patch, I simply 'die()' when a commit isn't able to be parsed
> (i.e., when 'parse_commit_no_graph' returns a non-zero code), but I
> wanted to see if others thought that this was an OK approach. Some
> thoughts:

I like the idea of completely bailing if the commit can't be parsed too. Only question: Is there a reason you chose to die() instead of BUG() like the other two places in that function? What is the criteria of choosing one over the other?

Show 5 quoted lines
> 
>    * It seems like we could write a commit-graph by placing a "filler"
>      entry where the broken commit would have gone. I don't see any place
>      where this is implemented currently, but this seems like a viable
>      alternative to not writing _any_ commits into the commit-graph.

I would rather we didn't do this cause it will probably kick open the can of always watching for that filler when we are working with the commit-graph. Or do we already do that today? Maybe @stolee can chime in on what we do in cases of shallow clones and other potential gaps in the walk

-Garima
Previous: Jeff KingNext: Taylor Blau
Message 17 of 20 in “commit-graph.c: handle corrupt commit trees”
  1. 0/1 commit-graph.c: handle corrupt commit treesTaylor Blau, Sep 4, 2019
  2. 1/1 commit-graph.c: die on un-parseable commitsTaylor Blau, Sep 4, 2019
  3. Jeff KingSep 4, 2019
  4. Taylor BlauSep 4, 2019
  5. Jeff KingSep 5, 2019
  6. Derrick StoleeSep 6, 2019
  7. Jeff KingSep 6, 2019
  8. Derrick StoleeSep 6, 2019
  9. Derrick StoleeSep 6, 2019
  10. Junio C HamanoSep 5, 2019
  11. Jeff KingSep 6, 2019
  12. Jeff KingSep 6, 2019
  13. Junio C HamanoSep 6, 2019
  14. Jeff KingSep 6, 2019
  15. Junio C HamanoSep 9, 2019
  16. Jeff KingSep 9, 2019
  17. Garima SinghSep 4, 2019
  18. Taylor BlauSep 4, 2019
  19. Jeff KingSep 5, 2019
  20. Derrick StoleeSep 6, 2019

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.