git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Aveling <bena.001@optusnet.com.au>
To: git@vger.kernel.org
Subject: fsck option to remove corrupt objects - why/why not?
Date: Thu, 16 Oct 2014 11:13:34 +1100	[thread overview]
Message-ID: <543F0DAE.2050205@optusnet.com.au> (raw)
In-Reply-To: <20141015234637.9B4FC781EFB@mail110.syd.optusnet.com.au>

On 14/10/2014 19:21, Jeff King wrote:
> On Mon, Oct 13, 2014 at 09:37:27AM +1100, Ben Aveling wrote:
>> A question about fsck - is there a reason it doesn't have an option to
>> delete bad objects?
> If the objects are reachable, then deleting them would create other big
> problems (i.e., we would be breaking the object graph!).

The man page for fsck advises:

    "Any corrupt objects you will have to find in backups or other
    archives (i.e., you can just remove them and do an /rsync/ with some
    other site in the hopes that somebody else has the object you have
    corrupted)."


And that seems sensible to me - the object is corrupt, it is unusable, 
the object graph is already broken, we already have big problems, 
removing the corrupt object(s) doesn't create any new problems, and it 
allows the possibility that the damaged objects can be restored.

I ask because I have a corrupt repository, and every time I run fsck, it 
reports one corrupt object, then stops. I could write a script to 
repeatedly call fsck and then remove the next corrupt object, but it 
raises the question for me; could it make sense to extend fsck with the 
option to do to the removes? Or even better, do the removes and then do 
the necessary [r]sync, assuming the user has another repository that has 
a good copy of the bad objects, which in this case I do.

Regards, Ben

       reply	other threads:[~2014-10-16  0:13 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 ` Ben Aveling [this message]
2014-10-16  9:04   ` fsck option to remove corrupt objects - why/why not? Johan Herland
2014-10-16 12:25     ` Jeff King
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=543F0DAE.2050205@optusnet.com.au \
    --to=bena.001@optusnet.com.au \
    --cc=git@vger.kernel.org \
    /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).