From: Jeff King <peff@peff.net>
To: Nicolas Pitre <nico@fluxnic.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 10:46:01 -0400 [thread overview]
Message-ID: <20101022144600.GA5554@sigill.intra.peff.net> (raw)
In-Reply-To: <alpine.LFD.2.00.1010220037250.2764@xanadu.home>
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
next prev parent reply other threads:[~2010-10-22 14:45 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 [this message]
2010-10-22 15:24 ` Drew Northup
2010-10-22 18:54 ` Nicolas Pitre
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=20101022144600.GA5554@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nico@fluxnic.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).