From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Davide Berardi <berardi.dav@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] Segmentation fault on non-commit objects.
Date: Thu, 31 Oct 2019 01:37:33 -0400 [thread overview]
Message-ID: <20191031053733.GA10050@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqbltz3qbc.fsf@gitster-ct.c.googlers.com>
On Wed, Oct 30, 2019 at 11:44:23AM +0900, Junio C Hamano wrote:
> 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
next prev parent reply other threads:[~2019-10-31 5:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-29 9:27 [PATCH] Segmentation fault on non-commit objects Davide Berardi
2019-10-29 13:11 ` Johannes Schindelin
2019-11-01 0:26 ` Davide Berardi
2019-10-29 14:06 ` Jeff King
2019-10-30 2:44 ` Junio C Hamano
2019-10-31 5:37 ` Jeff King [this message]
2019-10-31 10:43 ` Davide Berardi
2019-11-01 0:29 ` Davide Berardi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191031053733.GA10050@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=berardi.dav@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).