git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git fsck not identifying corrupted packs

From
Wesley J. Landaker <wjl@icecavern.net>
Date
Oct 19, 2009, 19:07 UTC
Message-ID
<200910191307.56989.wjl@icecavern.net>
In-Reply-To
<4ADC45C7.6090907@gmail.com>
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
Previous: Sergio CallegariNext: Matthieu Moy
Message 19 of 21 in “git fsck not identifying corrupted packs”
  1. Sergio CallegariOct 19, 2009
  2. Johannes SixtOct 19, 2009
  3. Johannes SchindelinOct 19, 2009
  4. Junio C HamanoOct 19, 2009
  5. Wesley J. LandakerOct 19, 2009
  6. Robin RosenbergOct 20, 2009
  7. Wesley J. LandakerOct 20, 2009
  8. Matthieu MoyOct 20, 2009
  9. Junio C HamanoOct 20, 2009
  10. Alex RiesenOct 20, 2009
  11. Johannes SchindelinOct 20, 2009
  12. Matthieu MoyOct 20, 2009
  13. fsck: default to "git fsck --full"Junio C Hamano, Oct 20, 2009
  14. Nicolas PitreOct 20, 2009
  15. Junio C HamanoOct 20, 2009
  16. Nicolas PitreOct 20, 2009
  17. Alex RiesenOct 20, 2009
  18. Sergio CallegariOct 19, 2009
  19. Wesley J. LandakerOct 19, 2009
  20. Matthieu MoyOct 20, 2009
  21. Gabor GombasOct 19, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.