git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jonathon Mah <me@jonathonmah.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCHv5] sha1_file: fix iterating loose alternate objects
Date: Mon, 2 Feb 2015 15:27:33 -0500	[thread overview]
Message-ID: <20150202202733.GB28915@peff.net> (raw)
In-Reply-To: <E05CAD49-755C-4F26-A527-597B1AD412D8@jonathonmah.com>

On Mon, Feb 02, 2015 at 12:05:54PM -0800, Jonathon Mah wrote:

> Simplified test per Junio (verified that it fails before and passes
> now). Punting on Jeff's "more elaborate example".

I think that's fine. I started to try to create such an example, but
it's actually rather tricky. If the alternate has the tip object, then
one of these must be true:

  1. It has all of the objects the tip depends on.

  2. It is missing an object, and this tip is part of the referenced
     history.

  3. It is missing an object, but this part of history is not
     referenced.

In case (1), we do not care about deleting objects from the base
repository; we already have another copy in the alternate.

In case (2), the alternate is corrupt, and all bets are off.

In case (3), we can only have dropped the object from the alternate by
pruning it and keeping the tip object that refers to it. Which is the
exact thing that this new code was added to avoid (to always keep
depended-upon objects).

So I actually do not see how the situation would come up in practice,
and possibly we could drop the iteration of the alternates' loose
objects entirely from this code. But certainly that is orthogonal to
Jonathon's fix (which is a true regression for the less-exotic case that
his test demonstrates).

-Peff

  reply	other threads:[~2015-02-02 20:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02 20:05 [PATCHv5] sha1_file: fix iterating loose alternate objects Jonathon Mah
2015-02-02 20:27 ` Jeff King [this message]
2015-02-02 20:49   ` Junio C Hamano
2015-02-02 21:02     ` Jeff King

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=20150202202733.GB28915@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@jonathonmah.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).