threads / discuss / 21276

git fsck not identifying corrupted packs

Subject: git fsck not identifying corrupted packs

## tl;dr

21 messages between Oct 19, 2009 and Oct 20, 2009.

replies: 20people: 10as markdown or json

Sergio Callegari· Oct 19, 2009, 07:56 UTC · lore
Hi,

I have a pack that contains a corrupted object. It is an old corrupted repo that I have conserved.

As expected, git gc cries out loud about it. It indicates an inflate error (data stream error with incorrect data check), and then the impossibility to read an object from a certain offset in the pack.

However, git fsck does not complain at all about the repo. I guess that for speed reasons, git fsck does not try to inflate the objects.

Is there a means to have fsck to a truly full check on the sanity of a repo?
This both on git 1.6.5.1 and 1.6.4.2.
Thanks
Sergio Callegari
Johannes Schindelin· Oct 19, 2009, 10:04 UTC · re: Johannes Sixt · lore

Re: git fsck not identifying corrupted packs

Hi,
On Mon, 19 Oct 2009, Johannes Sixt wrote:
Show 7 quoted lines
> Sergio Callegari schrieb:
> > Is there a means to have fsck to a truly full check on the sanity of a 
> > repo?
> 
> git fsck --full
> 
> RTFM, please.
Now, now.

If you were to test a new filesystem, say, wonderfulfs, and wanted to check its integrity, would you not just run "fsck-wonderfulfs" if that exists, rather than reading the fantamagastic manual? Would you not expect that it Does The Right Thing? Would you not expect that it follows the Law Of Minimal Surprise?

So FWIW I can see where Sergio is coming from.

Ciao, Dscho

Junio C Hamano· Oct 19, 2009, 19:03 UTC · re: Johannes Schindelin · lore

Re: git fsck not identifying corrupted packs

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 19 quoted lines
> On Mon, 19 Oct 2009, Johannes Sixt wrote:
>
>> Sergio Callegari schrieb:
>> > Is there a means to have fsck to a truly full check on the sanity of a 
>> > repo?
>> 
>> git fsck --full
>> 
>> RTFM, please.
>
> Now, now.
>
> If you were to test a new filesystem, say, wonderfulfs, and wanted to 
> check its integrity, would you not just run "fsck-wonderfulfs" if that 
> exists, rather than reading the fantamagastic manual?  Would you not 
> expect that it Does The Right Thing?  Would you not expect that it 
> follows the Law Of Minimal Surprise?
>
> So FWIW I can see where Sergio is coming from.

Linus and other git developers from the early days trained their fingers to type the command, every once in a while even without thinking, to check the consistency of the repository back when the lower core part of the git was still being developed. Developers who wanted to make sure that git correctly dealt with packfiles could deliberately trigger their creation and checked them after they were created carefully, but loose objects are the ones that are written by various commands from random codepaths. It made some technical sense to have a mode that checked only loose objects from the debugging point of view for that reason.

    Side note.  I think the help description of --full option is wrong (or
    at least stale).  We always look at alternate object store these days
    since e15ef66 (fsck: check loose objects from alternate object stores
    by default, 2009-01-30).  It probably should read "check packed
    objects fully" or something.

The above paragraph is merely a historical background, and in this case the "history" refers to early-to-mid 2005. Even for git developers there no longer is any reason to type "git fsck" in fear of some newly created objects might be corrupt due to recent change to git these days.

The reason we did not make "--full" the default is probably we trust our filesystems a bit too much. At least, we trusted filesystems more than we trusted the lower core part of git that was under development ;-)

Once a packfile is created and we always use it read-only, there didn't seem to be much point in suspecting that the underlying filesystems or disks may corrupt them in such a way that is not caught by the SHA-1 checksum over the entire packfile and per object checksum. That trust in the filesystems might have been a good tradeoff between fsck performance and reliability on platforms git was initially developed on and for, but it might not be true anymore as we run on more platforms these days.

It probably makes sense to ship 1.7.0 with a version of "fsck" in which "--full" is the default; it would still accept "--full" but it would be a no-op. This would be a backward incompatible change, but the difference is primarily about performance ("it takes a lot longer than before!"), and not correctness, so we probably can live with it. As I already said, there is not much reason to run "fsck" every five minutes anymore to begin with (unless your filesystem is so unreliable that it might eat one file every five minutes, that is).

It probably is also a good idea to add a "--loose" option that does what "fsck" currently does without "--full". It is a good name because (1) to people who do not know the internal of git, it means "check only loosely", which would discourage them from running "fack" with that option to begin with, and (2) to others, it exactly tells what the option makes the command check.

Wesley J. Landaker· Oct 19, 2009, 19:27 UTC · re: Junio C Hamano · lore

Re: git fsck not identifying corrupted packs

(Not CCing everyone, since this is mostly curiosa in the "using git as it was never intended" section):

On Monday 19 October 2009 13:03:42 Junio C Hamano wrote:
Show 7 quoted lines
> Once a packfile is created and we always use it read-only, there didn't
> seem to be much point in suspecting that the underlying filesystems or
> disks may corrupt them in such a way that is not caught by the SHA-1
> checksum over the entire packfile and per object checksum.  That trust in
> the filesystems might have been a good tradeoff between fsck performance
> and reliability on platforms git was initially developed on and for, but
> it might not be true anymore as we run on more platforms these days.

Filesystems are mostly reliable, but only until your crazy users do strange and terrible things. I have a real, non-toy environment where I use this stack as a [horrible] workaround for some issues beyond my control:

git -> ext4 -> lvm -> dmcrypt -> loop -> sshfs -> cygwin sshd -> SMB share

Amazingly, this works pretty reliably with many gigabytes of data in a git repository, even with the occasional crash because of flakiness with the "sshfs -> cygwin sshd" piece of the puzzle. But a good "git fsck" sure doesn't hurt in this environment! =)

Robin Rosenberg· Oct 20, 2009, 15:41 UTC · re: Wesley J. Landaker · lore

Re: git fsck not identifying corrupted packs

måndag 19 oktober 2009 21:27:48 skrev  Wesley J. Landaker:
Show 17 quoted lines
> (Not CCing everyone, since this is mostly curiosa in the "using git as it
> was never intended" section):
>
> On Monday 19 October 2009 13:03:42 Junio C Hamano wrote:
> > Once a packfile is created and we always use it read-only, there didn't
> > seem to be much point in suspecting that the underlying filesystems or
> > disks may corrupt them in such a way that is not caught by the SHA-1
> > checksum over the entire packfile and per object checksum.  That trust in
> > the filesystems might have been a good tradeoff between fsck performance
> > and reliability on platforms git was initially developed on and for, but
> > it might not be true anymore as we run on more platforms these days.
>
> Filesystems are mostly reliable, but only until your crazy users do strange
> and terrible things. I have a real, non-toy environment where I use this
> stack as a [horrible] workaround for some issues beyond my control:
>
> git -> ext4 -> lvm -> dmcrypt -> loop -> sshfs -> cygwin sshd -> SMB share
The obvious follow up question here is: Why?
-- robin
Wesley J. Landaker· Oct 20, 2009, 16:20 UTC · re: Robin Rosenberg · lore

Re: git fsck not identifying corrupted packs

On Tuesday 20 October 2009 09:41:50 Robin Rosenberg wrote:
> måndag 19 oktober 2009 21:27:48 skrev  Wesley J. Landaker:
> > (Not CCing everyone, since this is mostly curiosa in the "using git as
> > it was never intended" section):
[...]
Show 7 quoted lines
> > Filesystems are mostly reliable, but only until your crazy users do
> > strange and terrible things. I have a real, non-toy environment where I
> > use this stack as a [horrible] workaround for some issues beyond my
> > control:
> >
> > git -> ext4 -> lvm -> dmcrypt -> loop -> sshfs -> cygwin sshd -> SMB
> > share

My main point was to illustrate that having "git fsck" do a REALLY GOOD CHECK is still desirable, as we still haven't reached the days of file- system utopia where nothing ever gets corrupted (even with a smaller, simpler stack).

The actual application where I use this stack is because of odd requirements and circumstances like data must be physically stored on a particular Windows server on the network that uses a weird authentication method that samba doesn't support, and it has to go over the network encrypted anyway, there are lots of holes in the data, so I want ext4 for the extent support, file-size limitations on the target, etc.

It's a really an exotic love-hate mix between an off-by-one-please-no-never- again kind of situation coupled with a bit of "because I can".

> The obvious follow up question here is: Why?

If you are both nerdy and morbidly curious enough to care, send me a "but, no ... really, WHY?!" with the git list CC dropped and we can talk about details and/or other crazy stuff. (I don't want to get wildly off-topic on this list.)

Matthieu Moy· Oct 20, 2009, 06:26 UTC · re: Junio C Hamano · lore

Re: git fsck not identifying corrupted packs

Junio C Hamano <gitster@pobox.com> writes:
> Linus and other git developers from the early days [...]
Thanks for the historical background.
> It probably makes sense to ship 1.7.0 with a version of "fsck" in which
> "--full" is the default; it would still accept "--full" but it would be a
> no-op.
+1
> It probably is also a good idea to add a "--loose" option that does what
> "fsck" currently does without "--full".  It is a good name
+1 too.
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Junio C Hamano· Oct 20, 2009, 06:45 UTC · re: Matthieu Moy · lore

Re: git fsck not identifying corrupted packs

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 16 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Linus and other git developers from the early days [...]
>
> Thanks for the historical background.
>
>> It probably makes sense to ship 1.7.0 with a version of "fsck" in which
>> "--full" is the default; it would still accept "--full" but it would be a
>> no-op.
>
> +1
>
>> It probably is also a good idea to add a "--loose" option that does what
>> "fsck" currently does without "--full".  It is a good name
>
> +1 too.

Actually, I changed my mind. I do not think this so big that we need to wait for a major version bump. Why not shoot for 1.6.6?

Alex Riesen· Oct 20, 2009, 09:25 UTC · re: Junio C Hamano · lore

Re: git fsck not identifying corrupted packs

On Tue, Oct 20, 2009 at 08:45, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>>> It probably is also a good idea to add a "--loose" option that does what
>>> "fsck" currently does without "--full".  It is a good name
>>
>> +1 too.
>
> Actually, I changed my mind.  I do not think this so big that we need to
> wait for a major version bump.  Why not shoot for 1.6.6?
--no-full works
Johannes Schindelin· Oct 20, 2009, 10:22 UTC · re: Alex Riesen · lore

Re: git fsck not identifying corrupted packs

Hi,
On Tue, 20 Oct 2009, Alex Riesen wrote:
Show 11 quoted lines
> On Tue, Oct 20, 2009 at 08:45, Junio C Hamano <gitster@pobox.com> wrote:
> > Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> >>> It probably is also a good idea to add a "--loose" option that does what
> >>> "fsck" currently does without "--full".  It is a good name
> >>
> >> +1 too.
> >
> > Actually, I changed my mind.  I do not think this so big that we need to
> > wait for a major version bump.  Why not shoot for 1.6.6?
> 
> --no-full works

It works. Technically. For human users, though, --loose-objects-only (with a shortcut "--loose") would be better.

Disclaimer: this email was written by a bot and is valid without signature
Matthieu Moy· Oct 20, 2009, 11:56 UTC · re: Johannes Schindelin · lore

Re: git fsck not identifying corrupted packs

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 13 quoted lines
> Hi,
>
> On Tue, 20 Oct 2009, Alex Riesen wrote:
>
>> On Tue, Oct 20, 2009 at 08:45, Junio C Hamano <gitster@pobox.com> wrote:
>> > Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>> >>> It probably is also a good idea to add a "--loose" option that does what
>> >>> "fsck" currently does without "--full".  It is a good name
>> 
>> --no-full works
>
> It works.  Technically.  For human users, though, --loose-objects-only 
> (with a shortcut "--loose") would be better.

OTOH, the advantage of "--no-full" is that it's compatible with existing Git versions. If I learn Git 1.6.6 with --no-full, and use it in a script, then my stript works also with older Gits.

But anyway, I think very few people are actually interested in "git --no-full" (or call it whatever you like), so I don't think this is very important.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Junio C Hamano· Oct 20, 2009, 18:46 UTC · re: Matthieu Moy · lore

[RFC/PATCH] fsck: default to "git fsck --full"

Linus and other git developers from the early days trained their fingers to type the command, every once in a while even without thinking, to check the consistency of the repository back when the lower core part of the git was still being developed. Developers who wanted to make sure that git correctly dealt with packfiles could deliberately trigger their creation and checked them after they were created carefully, but loose objects are the ones that are written by various commands from random codepaths. It made some technical sense to have a mode that checked only loose objects from the debugging point of view for that reason.

Even for git developers, there no longer is any reason to type "git fsck" every five minutes these days, worried that some newly created objects might be corrupt due to recent change to git.

The reason we did not make "--full" the default is probably we trust our filesystems a bit too much. At least, we trusted filesystems more than we trusted the lower core part of git that was under development.

Once a packfile is created and we always use it read-only, there didn't seem to be much point in suspecting that the underlying filesystems or disks may corrupt them in such a way that is not caught by the SHA-1 checksum over the entire packfile and per object checksum. That trust in the filesystems might have been a good tradeoff between fsck performance and reliability on platforms git was initially developed on and for, but it may not be true anymore as we run on many more platforms these days.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 16 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> ...
>> On Tue, 20 Oct 2009, Alex Riesen wrote:
>> ...
>>> --no-full works
>>
>> It works.  Technically.  For human users, though, --loose-objects-only 
>> (with a shortcut "--loose") would be better.
>
> OTOH, the advantage of "--no-full" is that it's compatible with
> existing Git versions. If I learn Git 1.6.6 with --no-full, and use it
> in a script, then my stript works also with older Gits.
>
> But anyway, I think very few people are actually interested in "git
> --no-full" (or call it whatever you like), so I don't think this is
> very important.

For human users, I think --full vs --no-full is quite a nice suggestion, given that we already have advertised --full and people know the option.

Also people know that splicing "no-" after the double dash is often the way to negate a boolean-looking option.

The actual patch to do this is tiny, but that is just a bonus ;-)
 Documentation/RelNotes-1.6.6.txt |   10 ++++++++++
 Documentation/git-fsck.txt       |    5 +++--
 builtin-fsck.c                   |    2 +-
 3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/Documentation/RelNotes-1.6.6.txt b/Documentation/RelNotes-1.6.6.txt
index 5f1fecb..1896e05 100644
--- a/Documentation/RelNotes-1.6.6.txt
+++ b/Documentation/RelNotes-1.6.6.txt
@@ -1,6 +1,13 @@
 GIT v1.6.6 Release Notes
 ========================
 
+In this release, "git fsck" defaults to "git fsck --full" and checks
+packfiles.  If you prefer a quicker check only on loose objects (the
+old default), you can say "git fsck --no-full".  This has been
+supported by 1.5.4 and newer versions of git, so it is safe to write
+it in your script if you use slightly older git on some of your
+machines.
+
 In git 1.7.0, which is planned to be the release after 1.6.6, "git
 push" into a branch that is currently checked out will be refused by
 default.
@@ -38,6 +45,9 @@ Updates since v1.6.5
 
 (usability, bells and whistles)
 
+ * "git fsck" by default checks the packfiles (i.e. "--full" is the
+   default); you can turn it off with "git fsck --no-full".
+
  * "git log --decorate" shows the location of HEAD as well.
 
 (developers)
diff --git a/Documentation/git-fsck.txt b/Documentation/git-fsck.txt
index 287c4fc..6fe9484 100644
--- a/Documentation/git-fsck.txt
+++ b/Documentation/git-fsck.txt
@@ -10,7 +10,7 @@ SYNOPSIS
 --------
 [verse]
 'git fsck' [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]
-	 [--full] [--strict] [--verbose] [--lost-found] [<object>*]
+	 [--[no-]full] [--strict] [--verbose] [--lost-found] [<object>*]
 
 DESCRIPTION
 -----------
@@ -52,7 +52,8 @@ index file, all SHA1 references in .git/refs/*, and all reflogs (unless
 	or $GIT_DIR/objects/info/alternates,
 	and in packed git archives found in $GIT_DIR/objects/pack
 	and corresponding pack subdirectories in alternate
-	object pools.
+	object pools.  This is now default; you can turn it off
+	with --no-full.
 
 --strict::
 	Enable more strict checking, namely to catch a file mode
diff --git a/builtin-fsck.c b/builtin-fsck.c
index c58b0e3..2d88e45 100644
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
@@ -19,7 +19,7 @@ static int show_root;
 static int show_tags;
 static int show_unreachable;
 static int include_reflogs = 1;
-static int check_full;
+static int check_full = 1;
 static int check_strict;
 static int keep_cache_objects;
 static unsigned char head_sha1[20];
Nicolas Pitre· Oct 20, 2009, 19:00 UTC · re: Junio C Hamano · lore

Re: [RFC/PATCH] fsck: default to "git fsck --full"

On Tue, 20 Oct 2009, Junio C Hamano wrote:
Show 10 quoted lines
> diff --git a/Documentation/RelNotes-1.6.6.txt b/Documentation/RelNotes-1.6.6.txt
> index 5f1fecb..1896e05 100644
> --- a/Documentation/RelNotes-1.6.6.txt
> +++ b/Documentation/RelNotes-1.6.6.txt
> @@ -1,6 +1,13 @@
>  GIT v1.6.6 Release Notes
>  ========================
>  
> +In this release, "git fsck" defaults to "git fsck --full" and checks
> +packfiles.  If you prefer a quicker check only on loose objects (the
             ^^

Might be worth mentioning explicitly that, because of that change, plain fsck is now going to take much longer to complete.

Nicolas
Junio C Hamano· Oct 20, 2009, 19:11 UTC · re: Nicolas Pitre · lore

Re: [RFC/PATCH] fsck: default to "git fsck --full"

Nicolas Pitre <nico@fluxnic.net> writes:
Show 16 quoted lines
> On Tue, 20 Oct 2009, Junio C Hamano wrote:
>
>> diff --git a/Documentation/RelNotes-1.6.6.txt b/Documentation/RelNotes-1.6.6.txt
>> index 5f1fecb..1896e05 100644
>> --- a/Documentation/RelNotes-1.6.6.txt
>> +++ b/Documentation/RelNotes-1.6.6.txt
>> @@ -1,6 +1,13 @@
>>  GIT v1.6.6 Release Notes
>>  ========================
>>  
>> +In this release, "git fsck" defaults to "git fsck --full" and checks
>> +packfiles.  If you prefer a quicker check only on loose objects (the
>              ^^
>
> Might be worth mentioning explicitly that, because of that change, plain 
> fsck is now going to take much longer to complete.
Sounds fair; thanks.
diff --git a/Documentation/RelNotes-1.6.6.txt b/Documentation/RelNotes-1.6.6.txt
index 0adf998..fa0e11a 100644
--- a/Documentation/RelNotes-1.6.6.txt
+++ b/Documentation/RelNotes-1.6.6.txt
@@ -2,7 +2,8 @@ GIT v1.6.6 Release Notes
 ========================
 
 In this release, "git fsck" defaults to "git fsck --full" and checks
-packfiles.  If you prefer a quicker check only on loose objects (the
+packfiles, and because of this it will take much longer to complete
+than before.  If you prefer a quicker check only on loose objects (the
 old default), you can say "git fsck --no-full".  This has been
 supported by 1.5.4 and newer versions of git, so it is safe to write
 it in your script even if you use slightly older git on some of your
Nicolas Pitre· Oct 20, 2009, 18:39 UTC · re: Junio C Hamano · lore

Re: git fsck not identifying corrupted packs

On Mon, 19 Oct 2009, Junio C Hamano wrote:
> Actually, I changed my mind.  I do not think this so big that we need to
> wait for a major version bump.  Why not shoot for 1.6.6?

Agreed. With a prominent note in the release notes to point people at it when they don't read release notes and complain that fsck suddenly became very slow after they upgraded.

Nicolas
Alex Riesen· Oct 20, 2009, 20:49 UTC · re: Nicolas Pitre · lore

Re: git fsck not identifying corrupted packs

On Tue, Oct 20, 2009 at 20:39, Nicolas Pitre <nico@fluxnic.net> wrote:
Show 8 quoted lines
> On Mon, 19 Oct 2009, Junio C Hamano wrote:
>
>> Actually, I changed my mind.  I do not think this so big that we need to
>> wait for a major version bump.  Why not shoot for 1.6.6?
>
> Agreed.  With a prominent note in the release notes to point people at
> it when they don't read release notes and complain that fsck suddenly
> became very slow after they upgraded.

I have a feeling that it either wont be noticed at all (i.e., I have run fsck with something other than --full only one time in my whole bash history, and never shown it otherwise to anyone else), or people will immediately like it ("Oh, finallly! Now that feels like it is doing something!" :)

Sergio Callegari· Oct 19, 2009, 10:56 UTC · re: Johannes Sixt · lore

Re: git fsck not identifying corrupted packs

Johannes Sixt wrote:
Show 10 quoted lines
> Sergio Callegari schrieb:
>   
>> Is there a means to have fsck to a truly full check on the sanity of a repo?
>>     
>
> git fsck --full
>
> RTFM, please.
>
>   
Right... sorry for the noise, I mismatched --strict for --full in a script.

BTW, the short help for fsck at --full only says "consider objects in alternate repositories".

My apologize.
Sergio
Wesley J. Landaker· Oct 19, 2009, 19:07 UTC · re: Sergio Callegari · lore

Re: git fsck not identifying corrupted packs

On Monday 19 October 2009 04:56:07 Sergio Callegari wrote:
Show 14 quoted lines
> Johannes Sixt wrote:
> > Sergio Callegari schrieb:
> >> Is there a means to have fsck to a truly full check on the sanity of a
> >> repo?
> >
> > git fsck --full
> >
> > RTFM, please.
>
> Right... sorry for the noise, I mismatched --strict for --full in a
> script.
>
> BTW, the short help for fsck at --full only says "consider objects in
> alternate repositories".

Until I read this thread, I didn't realize you needed --full to check objects in packs.

Since just every git repository I ever use has 99%+ of it's objects in packs, this means every time I've run "git fsck" it's essentially been a no-op and I didn't know it. I imagine this is a common confusion.

Also, having --full mean both "check alternate object pools", and "check objects in packs" seems to be rolling up two orthogonal issues.

But anyway, here is a patch that at least fixes the short option help to match the manual and the current behavior:

--- 8< ---
From 8fc3cd68d496bf00faad4f0a7b6ae4fee9437e68 Mon Sep 17 00:00:00 2001
From: Wesley J. Landaker <wjl@icecavern.net>
Date: Mon, 19 Oct 2009 12:48:07 -0600
Subject: [PATCH] Update git fsck --full short description to mention packs
The '--full' option to git fsck does two things:
  1) Check objects in packs
  2) Check alternate objects

This is documented in the git fsck manual; this patch reflects that in the short git fsck option help message as well.

Signed-off-by: Wesley J. Landaker <wjl@icecavern.net>
---
 builtin-fsck.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-fsck.c b/builtin-fsck.c
index c58b0e3..63212ea 100644
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
@@ -576,7 +576,7 @@ static struct option fsck_opts[] = {
 	OPT_BOOLEAN(0, "root", &show_root, "report root nodes"),
 	OPT_BOOLEAN(0, "cache", &keep_cache_objects, "make index objects head nodes"),
 	OPT_BOOLEAN(0, "reflogs", &include_reflogs, "make reflogs head nodes (default)"),
-	OPT_BOOLEAN(0, "full", &check_full, "also consider alternate objects"),
+	OPT_BOOLEAN(0, "full", &check_full, "also consider packs and alternate objects"),
 	OPT_BOOLEAN(0, "strict", &check_strict, "enable more strict checking"),
 	OPT_BOOLEAN(0, "lost-found", &write_lost_and_found,
 				"write dangling objects in .git/lost-found"),
-- 
1.6.5
Matthieu Moy· Oct 20, 2009, 06:24 UTC · re: Wesley J. Landaker · lore

Re: git fsck not identifying corrupted packs

"Wesley J. Landaker" <wjl@icecavern.net> writes:
> Until I read this thread, I didn't realize you needed --full to check
> objects in packs.
Same here.
> -	OPT_BOOLEAN(0, "full", &check_full, "also consider alternate objects"),
> +	OPT_BOOLEAN(0, "full", &check_full, "also consider packs and alternate objects"),

IMHO, something like this should be applied to "maint", this is kind of a serious bug indeed. Just check the "alternate" thing, according to Junio:

Junio C Hamano <gitster@pobox.com> writes:
Show 5 quoted lines
>     Side note.  I think the help description of --full option is wrong (or
>     at least stale).  We always look at alternate object store these days
>     since e15ef66 (fsck: check loose objects from alternate object stores
>     by default, 2009-01-30).  It probably should read "check packed
>     objects fully" or something.
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Gabor Gombas· Oct 19, 2009, 18:36 UTC · re: Johannes Sixt · lore

Re: git fsck not identifying corrupted packs

On Mon, Oct 19, 2009 at 11:11:33AM +0200, Johannes Sixt wrote:
Show 5 quoted lines
> > Is there a means to have fsck to a truly full check on the sanity of a repo?
> 
> git fsck --full
> 
> RTFM, please.

That still does not catch everything. About a week ago I wanted to check out a branch in a local repo and I got an error that it was corrupt. But "git fsck --full" only complained about some dangling objects, it did not notice the corruption. I used git version 1.6.4.3 (Debian unstable at that time). It would be nice to have a "git fsck --i-really-want-to-check-everything".

Gabor
-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------

← back to recent threads