From: Jeff King <peff@peff.net>
To: Johan Herland <johan@herland.net>
Cc: Ben Aveling <bena.001@optusnet.com.au>,
Git mailing list <git@vger.kernel.org>
Subject: Re: fsck option to remove corrupt objects - why/why not?
Date: Thu, 16 Oct 2014 08:25:33 -0400 [thread overview]
Message-ID: <20141016122533.GA8451@peff.net> (raw)
In-Reply-To: <CALKQrgda8mVbqP5=Ag8juN9HMQp7iQ9eDJETfRJe1b0taAFGkg@mail.gmail.com>
On Thu, Oct 16, 2014 at 11:04:04AM +0200, Johan Herland wrote:
> I simply copied the packfile containing the good copy into the
> corrupted repo, and then ran a "git gc", which "happened" to use the
> good copy of the corrupted object and complete successfully (instead
> of barfing on the bad copy). The GC then removed the old
> (now-obsolete) packfiles, and thus the corruption was gone.
>
> However, exactly _why_ git happened to prefer the good copy in my
> copied packfile instead of the bad copy in the existing packfile, I do
> not know. I suspect some amount of pure luck was involved.
I'm not sure that it is luck, but more like 8eca0b4 (implement some
resilience against pack corruptions, 2008-06-23) working as intended[1].
Generally, git should be able to warn about corrupted objects and look
in other packs for them (both for regular operations, and for
repacking).
-Peff
[1] That's just one of the many commits dealing with this. Try running
"git log --author=Nicolas.Pitre --grep=corrupt" for more. :)
next prev parent reply other threads:[~2014-10-16 12:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20141015234637.9B4FC781EFB@mail110.syd.optusnet.com.au>
2014-10-16 0:13 ` fsck option to remove corrupt objects - why/why not? Ben Aveling
2014-10-16 9:04 ` Johan Herland
2014-10-16 12:25 ` Jeff King [this message]
2014-10-16 12:48 ` Johan Herland
2014-10-16 16:36 ` Junio C Hamano
2014-10-16 11:59 ` Matthieu Moy
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=20141016122533.GA8451@peff.net \
--to=peff@peff.net \
--cc=bena.001@optusnet.com.au \
--cc=git@vger.kernel.org \
--cc=johan@herland.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).