From: Nicolas Pitre <nico@fluxnic.net>
To: Jeff King <peff@peff.net>
Cc: 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:42:09 -0400 (EDT) [thread overview]
Message-ID: <alpine.LFD.2.00.1010221427390.2764@xanadu.home> (raw)
In-Reply-To: <20101022144600.GA5554@sigill.intra.peff.net>
On Fri, 22 Oct 2010, 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;
Well, this get called repeatedly, being within the inner part of the
delta search loop. So you might get that warning as many times as the
delta window which is not that nice. If anything a static flag to
display the warning only once would be needed. But you're pretty likely
to have met that warning/error already from other operations, which is
why I didn't bother.
> Or will some other part of the code already complained to stderr?
Some other part is likely to already have complained, through
check_object() -> sha1_object_info(). But not necessarily in all cases.
Nicolas
next prev parent reply other threads:[~2010-10-22 18:44 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
2010-10-22 18:42 ` Nicolas Pitre [this message]
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.1010221427390.2764@xanadu.home \
--to=nico@fluxnic.net \
--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).