From: Nicolas Pitre <nico@fluxnic.net>
To: Drew Northup <drew.northup@maine.edu>
Cc: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: [PATCH] make pack-objects a bit more resilient to repo corruption
Date: Fri, 22 Oct 2010 14:54:40 -0400 (EDT) [thread overview]
Message-ID: <alpine.LFD.2.00.1010221451340.2764@xanadu.home> (raw)
In-Reply-To: <1287761064.31218.37.camel@drew-northup.unet.maine.edu>
On Fri, 22 Oct 2010, Drew Northup wrote:
>
> On Fri, 2010-10-22 at 10:46 -0400, Jeff King wrote:
> > On Fri, Oct 22, 2010 at 12:53:32AM -0400, Nicolas Pitre wrote:
> >
> > > - if (!src->data)
> > > + if (!src->data) {
> > > + if (src_entry->preferred_base) {
> > > + /*
> > > + * Those objects are not included in the
> > > + * resulting pack. Be resilient and ignore
> > > + * them if they can't be read, in case the
> > > + * pack could be created nevertheless.
> > > + */
> > > + return 0;
> > > + }
> > > die("object %s cannot be read",
> > > sha1_to_hex(src_entry->idx.sha1));
> > > + }
> >
> > By converting this die() into a silent return, are we losing a place
> > where git might previously have alerted a user to corruption? In this
> > case, we can continue the operation without the object, but if we have
> > detected corruption, letting the user know as soon as possible is
> > probably a good idea.
> >
> > In other words, should this instead be:
> >
> > warning("unable to read preferred base object: %s", ...);
> > return 0;
> >
> > Or will some other part of the code already complained to stderr?
> >
> > -Peff
>
> Agreed. If it broke we should probably tell the user--even if we can't
> do much useful about it other than attempt to recover by continuing.
Please don't misinterpret this case. As far as this change is
concerned, nothing is actually "broken". The operation _will_ still
succeed. The repository may be broken, but in this case we can do
without the broken object. In those cases where the object is really
needed the original die() is still in place.
Nicolas
next prev parent reply other threads:[~2010-10-22 18:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-22 4:53 [PATCH] make pack-objects a bit more resilient to repo corruption Nicolas Pitre
2010-10-22 14:46 ` Jeff King
2010-10-22 15:24 ` Drew Northup
2010-10-22 18:54 ` Nicolas Pitre [this message]
2010-10-22 18:42 ` Nicolas Pitre
2010-10-22 20:26 ` [PATCH v2] " Nicolas Pitre
2010-10-22 20:50 ` Sverre Rabbelier
2010-10-22 21:19 ` Nicolas Pitre
2010-10-22 21:59 ` Junio C Hamano
2010-10-24 2:26 ` Geert Bosch
2010-10-24 2:47 ` Nicolas Pitre
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=alpine.LFD.2.00.1010221451340.2764@xanadu.home \
--to=nico@fluxnic.net \
--cc=drew.northup@maine.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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).