summaryrefslogtreecommitdiff
path: root/builtin-fsck.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-10-20 11:46:55 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-10-20 12:11:39 -0700
commitf29cd3938dbe9300dd75096d8ee2ad6311cc00af (patch)
tree96fb0434a82266bafedc6ecbbb4a55fcd2c354c2 /builtin-fsck.c
parentMerge branch 'maint' (diff)
downloadtgif-f29cd3938dbe9300dd75096d8ee2ad6311cc00af.tar.xz
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>
Diffstat (limited to 'builtin-fsck.c')
-rw-r--r--builtin-fsck.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-fsck.c b/builtin-fsck.c
index c58b0e337e..2d88e4570f 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];