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

Re: [PATCH] Segmentation fault on non-commit objects.

From
Jeff King <peff@peff.net>
Date
Oct 31, 2019, 05:37 UTC
Message-ID
<20191031053733.GA10050@sigill.intra.peff.net>
In-Reply-To
<xmqqbltz3qbc.fsf@gitster-ct.c.googlers.com>
On Wed, Oct 30, 2019 at 11:44:23AM +0900, Junio C Hamano wrote:
Show 20 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > This is definitely a strict improvement over the current behavior
> > (though I agree with Dscho's comments on the error message). A few
> > further thoughts:
> >
> >   - we'll have successfully completed the rest of the clone at this
> >     point. Should we leave the objects and refs in place to allow the
> >     user to fix it up, as we do when "git checkout" fails?
> >
> >     We'd have to leave _something_ in HEAD for it to be a valid repo. I
> >     guess just "refs/heads/master" would be fine, or perhaps we could
> >     fall back to whatever the other side had in their HEAD (i.e.,
> >     pretending that "-b" wasn't specified).
> 
> Do we know for sure that the object at HEAD on the other side is a
> commit, or do we need to prepare for a case where it is not?  I
> suspect it is the latter.  HEAD needs to exist and point at a ref
> that is in refs/heads/ hierarchy, and the ref can even be unborn, so
> falling back on 'master' sounds like a good position.

Yeah, I don't think that we do. This is the same as the case I mentioned later, and it should be handled in all three arms of the conditional.

Davide, do you have an interest in trying to make these code paths a bit more robust?

-Peff
Previous: Junio C HamanoNext: Davide Berardi
Message 6 of 8 in “Segmentation fault on non-commit objects.”
  1. Segmentation fault on non-commit objects.Davide Berardi, Oct 29, 2019
  2. Johannes SchindelinOct 29, 2019
  3. Davide BerardiNov 1, 2019
  4. Jeff KingOct 29, 2019
  5. Junio C HamanoOct 30, 2019
  6. Jeff KingOct 31, 2019
  7. Davide BerardiOct 31, 2019
  8. Davide BerardiNov 1, 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.