{"thread":{"id":"17455","subject":"[PATCH 2/5] verify_pack(): allow a quicker verification for a pack with version 2 idx","startedAt":"2009-01-30T11:05:12Z","lastAt":"2009-02-01T00:52:58Z","messageCount":10,"participants":["Junio C Hamano","Kjetil Barvik","Nanako Shiraishi","Marius Storm-Olsen"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"102566","messageId":"1233313517-24208-1-git-send-email-gitster@pobox.com","threadId":"17455","inReplyTo":null,"subject":"[PATCH 0/5] fsck updates","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-30T11:05:12Z","receivedAt":"2009-01-30T11:05:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"These go on top of the previous two patches I sent earlier.\n\nJunio C Hamano (5):\n  pack-check.c: minor formatting fix to match coding style\n  verify_pack(): allow a quicker verification for a pack with version 2 idx\n  verify-pack: add --quick\n  fsck: three levels of validation\n  [squash] fsck: revert --quick to the default and introduce --medium\n\n builtin-fsck.c        |   13 ++++++++++---\n builtin-verify-pack.c |   10 +++++++---\n http-push.c           |    2 +-\n http-walker.c         |    2 +-\n pack-check.c          |   36 ++++++++++++++++++++++++------------\n pack.h                |    5 ++++-\n 6 files changed, 47 insertions(+), 21 deletions(-)\n"},{"id":"102565","messageId":"1233313517-24208-2-git-send-email-gitster@pobox.com","threadId":"17455","inReplyTo":"1233313517-24208-1-git-send-email-gitster@pobox.com","subject":"[PATCH 1/5] pack-check.c: minor formatting fix to match coding style","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-30T11:05:13Z","receivedAt":"2009-01-30T11:05:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Adjust misaligned columns and multi-line comments that violate our coding\nstyle before touching this file.\n\nAlso fix an obvious typo.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n pack-check.c |   21 ++++++++++++---------\n 1 files changed, 12 insertions(+), 9 deletions(-)\n\ndiff --git a/pack-check.c b/pack-check.c\nindex 90c33b1..2c5f521 100644\n--- a/pack-check.c\n+++ b/pack-check.c\n@@ -4,7 +4,7 @@\n \n struct idx_entry\n {\n-\toff_t                offset;\n+\toff_t offset;\n \tconst unsigned char *sha1;\n \tunsigned int nr;\n };\n@@ -43,7 +43,7 @@ int check_pack_crc(struct packed_git *p, struct pack_window **w_curs,\n }\n \n static int verify_packfile(struct packed_git *p,\n-\t\tstruct pack_window **w_curs)\n+\t\t\t   struct pack_window **w_curs)\n {\n \toff_t index_size = p->index_size;\n \tconst unsigned char *index_base = p->index_data;\n@@ -54,7 +54,8 @@ static int verify_packfile(struct packed_git *p,\n \tint err = 0;\n \tstruct idx_entry *entries;\n \n-\t/* Note that the pack header checks are actually performed by\n+\t/*\n+\t * Note that the pack header checks are actually performed by\n \t * use_pack when it first opens the pack file.  If anything\n \t * goes wrong during those checks then the call will die out\n \t * immediately.\n@@ -72,21 +73,23 @@ static int verify_packfile(struct packed_git *p,\n \tgit_SHA1_Final(sha1, &ctx);\n \tpack_sig = use_pack(p, w_curs, pack_sig_ofs, NULL);\n \tif (hashcmp(sha1, pack_sig))\n-\t\terr = error(\"%s SHA1 checksum mismatch\",\n-\t\t\t    p->pack_name);\n+\t\terr = error(\"%s SHA1 checksum mismatch\", p->pack_name);\n \tif (hashcmp(index_base + index_size - 40, pack_sig))\n-\t\terr = error(\"%s SHA1 does not match its inddex\",\n-\t\t\t    p->pack_name);\n+\t\terr = error(\"%s SHA1 does not match its index\", p->pack_name);\n \tunuse_pack(w_curs);\n \n-\t/* Make sure everything reachable from idx is valid.  Since we\n+\t/*\n+\t * Make sure everything reachable from idx is valid.  Since we\n \t * have verified that nr_objects matches between idx and pack,\n \t * we do not do scan-streaming check on the pack file.\n \t */\n \tnr_objects = p->num_objects;\n \tentries = xmalloc((nr_objects + 1) * sizeof(*entries));\n \tentries[nr_objects].offset = pack_sig_ofs;\n-\t/* first sort entries by pack offset, since unpacking them is more efficient that way */\n+\t/*\n+\t * First sort entries by pack offset, since unpacking them is more\n+\t * efficient that way.\n+\t */\n \tfor (i = 0; i < nr_objects; i++) {\n \t\tentries[i].sha1 = nth_packed_object_sha1(p, i);\n \t\tif (!entries[i].sha1)\n-- \n1.6.1.2.312.g5be3c\n"},{"id":"102564","messageId":"1233313517-24208-3-git-send-email-gitster@pobox.com","threadId":"17455","inReplyTo":"1233313517-24208-2-git-send-email-gitster@pobox.com","subject":"[PATCH 2/5] verify_pack(): allow a quicker verification for a pack with version 2 idx","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-30T11:05:14Z","receivedAt":"2009-01-30T11:05:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This adds an extra flag parameter to verify_pack() so that the caller can\naffect what kind of checks are performed.\n\nFor a packfile, we always validate its whole SHA-1 checksum and the pack\nheader.  By default, we make sure that we can unpack all the objects in\nthe packfile, and the unpacked data actually matches their object name.\nIn addition, for a pack with version 2 idx that has per-object CRC, we\nverify their CRC checksum match what is recorded.\n\nBy specifying VERIFY_PACK_QUICK, you can omit the expensive per-object\nunpacking and object name validation. Per-object CRC check that is done\nfor objects in a pack with version 2 idx file is still performed as it is\ninexpensive.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin-fsck.c        |    2 +-\n builtin-verify-pack.c |    2 +-\n http-push.c           |    2 +-\n http-walker.c         |    2 +-\n pack-check.c          |   17 +++++++++++++----\n pack.h                |    5 ++++-\n 6 files changed, 21 insertions(+), 9 deletions(-)\n\ndiff --git a/builtin-fsck.c b/builtin-fsck.c\nindex 64dffa5..8dc7881 100644\n--- a/builtin-fsck.c\n+++ b/builtin-fsck.c\n@@ -614,7 +614,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)\n \t\tprepare_packed_git();\n \t\tfor (p = packed_git; p; p = p->next)\n \t\t\t/* verify gives error messages itself */\n-\t\t\tverify_pack(p);\n+\t\t\tverify_pack(p, 0);\n \n \t\tfor (p = packed_git; p; p = p->next) {\n \t\t\tuint32_t j, num;\ndiff --git a/builtin-verify-pack.c b/builtin-verify-pack.c\nindex 25a29f1..42ae406 100644\n--- a/builtin-verify-pack.c\n+++ b/builtin-verify-pack.c\n@@ -93,7 +93,7 @@ static int verify_one_pack(const char *path, int verbose)\n \t\treturn error(\"packfile %s not found.\", arg);\n \n \tinstall_packed_git(pack);\n-\terr = verify_pack(pack);\n+\terr = verify_pack(pack, 0);\n \n \tif (verbose) {\n \t\tif (err)\ndiff --git a/http-push.c b/http-push.c\nindex 59037df..0cd2926 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -809,7 +809,7 @@ static void finish_request(struct transfer_request *request)\n \t\t\t\t\tlst = &((*lst)->next);\n \t\t\t\t*lst = (*lst)->next;\n \n-\t\t\t\tif (!verify_pack(target))\n+\t\t\t\tif (!verify_pack(target, 0))\n \t\t\t\t\tinstall_packed_git(target);\n \t\t\t\telse\n \t\t\t\t\tremote->can_update_info_refs = 0;\ndiff --git a/http-walker.c b/http-walker.c\nindex 0dbad3c..7f314b0 100644\n--- a/http-walker.c\n+++ b/http-walker.c\n@@ -797,7 +797,7 @@ static int fetch_pack(struct walker *walker, struct alt_base *repo, unsigned cha\n \t\tlst = &((*lst)->next);\n \t*lst = (*lst)->next;\n \n-\tif (verify_pack(target))\n+\tif (verify_pack(target, 0))\n \t\treturn -1;\n \tinstall_packed_git(target);\n \ndiff --git a/pack-check.c b/pack-check.c\nindex 2c5f521..256370c 100644\n--- a/pack-check.c\n+++ b/pack-check.c\n@@ -42,8 +42,8 @@ int check_pack_crc(struct packed_git *p, struct pack_window **w_curs,\n \treturn data_crc != ntohl(*index_crc);\n }\n \n-static int verify_packfile(struct packed_git *p,\n-\t\t\t   struct pack_window **w_curs)\n+static int verify_packfile(struct packed_git *p, struct pack_window **w_curs,\n+\t\t\t   unsigned flag)\n {\n \toff_t index_size = p->index_size;\n \tconst unsigned char *index_base = p->index_data;\n@@ -78,6 +78,12 @@ static int verify_packfile(struct packed_git *p,\n \t\terr = error(\"%s SHA1 does not match its index\", p->pack_name);\n \tunuse_pack(w_curs);\n \n+\tif ((flag & VERIFY_PACK_QUICK) && p->index_version <= 1) {\n+\t\twarning(\"contents not checked for %s as its .idx does not have CRC\",\n+\t\t\tp->pack_name);\n+\t\treturn err;\n+\t}\n+\n \t/*\n \t * Make sure everything reachable from idx is valid.  Since we\n \t * have verified that nr_objects matches between idx and pack,\n@@ -114,6 +120,9 @@ static int verify_packfile(struct packed_git *p,\n \t\t\t\t\t    sha1_to_hex(entries[i].sha1),\n \t\t\t\t\t    p->pack_name, (uintmax_t)offset);\n \t\t}\n+\n+\t\tif (flag & VERIFY_PACK_QUICK)\n+\t\t\tcontinue;\n \t\tdata = unpack_entry(p, entries[i].offset, &type, &size);\n \t\tif (!data) {\n \t\t\terr = error(\"cannot unpack %s from %s at offset %\"PRIuMAX\"\",\n@@ -134,7 +143,7 @@ static int verify_packfile(struct packed_git *p,\n \treturn err;\n }\n \n-int verify_pack(struct packed_git *p)\n+int verify_pack(struct packed_git *p, unsigned flag)\n {\n \toff_t index_size;\n \tconst unsigned char *index_base;\n@@ -157,7 +166,7 @@ int verify_pack(struct packed_git *p)\n \t\t\t    p->pack_name);\n \n \t/* Verify pack file */\n-\terr |= verify_packfile(p, &w_curs);\n+\terr |= verify_packfile(p, &w_curs, flag);\n \tunuse_pack(&w_curs);\n \n \treturn err;\ndiff --git a/pack.h b/pack.h\nindex a883334..b9e381c 100644\n--- a/pack.h\n+++ b/pack.h\n@@ -57,7 +57,10 @@ struct pack_idx_entry {\n \n extern char *write_idx_file(char *index_name, struct pack_idx_entry **objects, int nr_objects, unsigned char *sha1);\n extern int check_pack_crc(struct packed_git *p, struct pack_window **w_curs, off_t offset, off_t len, unsigned int nr);\n-extern int verify_pack(struct packed_git *);\n+\n+#define VERIFY_PACK_QUICK 01\n+extern int verify_pack(struct packed_git *, unsigned flag);\n+\n extern void fixup_pack_header_footer(int, unsigned char *, const char *, uint32_t, unsigned char *, off_t);\n extern char *index_pack_lockfile(int fd);\n \n-- \n1.6.1.2.312.g5be3c\n"},{"id":"102568","messageId":"1233313517-24208-4-git-send-email-gitster@pobox.com","threadId":"17455","inReplyTo":"1233313517-24208-3-git-send-email-gitster@pobox.com","subject":"[PATCH 3/5] verify-pack: add --quick","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-30T11:05:15Z","receivedAt":"2009-01-30T11:05:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This teaches \"git verify-pack\" a new option --quick, to trigger the\nVERIFY_PACK_QUICK option.\n\n\"git fsck\" is a more familiar command, and it checks more things at once\nthan \"git verify-pack\", and the case you do want to use the latter is when\nreally want a deep verification of a single pack.  For this reason, I do\nnot think anybody would want to actually use this option, but it was an\neasy way to benchmark the change.\n\nFor a 32M packfile from the git repository on my AMD64X2:\n\n    $ /usr/bin/time ./git-verify-pack $THE_PACKFILE\n    22.16user 0.18system 0:22.35elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k\n    0inputs+0outputs (0major+44166minor)pagefaults 0swaps\n\n    $ /usr/bin/time ./git-verify-pack --quick $THE_PACKFILE\n    0.43user 0.02system 0:00.45elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k\n    0inputs+0outputs (0major+11569minor)pagefaults 0swaps\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin-verify-pack.c |   10 +++++++---\n 1 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-verify-pack.c b/builtin-verify-pack.c\nindex 42ae406..fdc04d1 100644\n--- a/builtin-verify-pack.c\n+++ b/builtin-verify-pack.c\n@@ -54,12 +54,13 @@ static void show_pack_info(struct packed_git *p)\n \t\t       chain_histogram[0], chain_histogram[0] > 1 ? \"s\" : \"\");\n }\n \n-static int verify_one_pack(const char *path, int verbose)\n+static int verify_one_pack(const char *path, int verbose, int quick)\n {\n \tchar arg[PATH_MAX];\n \tint len;\n \tstruct packed_git *pack;\n \tint err;\n+\tunsigned flag = (quick ? VERIFY_PACK_QUICK : 0);\n \n \tlen = strlcpy(arg, path, PATH_MAX);\n \tif (len >= PATH_MAX)\n@@ -93,7 +94,7 @@ static int verify_one_pack(const char *path, int verbose)\n \t\treturn error(\"packfile %s not found.\", arg);\n \n \tinstall_packed_git(pack);\n-\terr = verify_pack(pack, 0);\n+\terr = verify_pack(pack, flag);\n \n \tif (verbose) {\n \t\tif (err)\n@@ -112,6 +113,7 @@ static const char verify_pack_usage[] = \"git-verify-pack [-v] <pack>...\";\n int cmd_verify_pack(int argc, const char **argv, const char *prefix)\n {\n \tint err = 0;\n+\tint quick = 0;\n \tint verbose = 0;\n \tint no_more_options = 0;\n \tint nothing_done = 1;\n@@ -121,13 +123,15 @@ int cmd_verify_pack(int argc, const char **argv, const char *prefix)\n \t\tif (!no_more_options && argv[1][0] == '-') {\n \t\t\tif (!strcmp(\"-v\", argv[1]))\n \t\t\t\tverbose = 1;\n+\t\t\telse if (!strcmp(\"--quick\", argv[1]))\n+\t\t\t\tquick = 1;\n \t\t\telse if (!strcmp(\"--\", argv[1]))\n \t\t\t\tno_more_options = 1;\n \t\t\telse\n \t\t\t\tusage(verify_pack_usage);\n \t\t}\n \t\telse {\n-\t\t\tif (verify_one_pack(argv[1], verbose))\n+\t\t\tif (verify_one_pack(argv[1], verbose, quick))\n \t\t\t\terr = 1;\n \t\t\tdiscard_revindex();\n \t\t\tnothing_done = 0;\n-- \n1.6.1.2.312.g5be3c\n"},{"id":"102569","messageId":"1233313517-24208-5-git-send-email-gitster@pobox.com","threadId":"17455","inReplyTo":"1233313517-24208-4-git-send-email-gitster@pobox.com","subject":"[PATCH 4/5] fsck: three levels of validation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-30T11:05:16Z","receivedAt":"2009-01-30T11:05:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Traditionally, \"git fsck\" only checked loose objects and \"git fsck --full\"\nchecked both loose and packed objects fully.\n\nThis introduces a new medium level of validation that checks loose objects\nand runs the quicker packfile validation introduced earlier (in other\nwords, the individual objects in packfiles are not validated, but we still\nmake sure that the packfiles themselves are sound and individual objects\npass their own CRC checks when the pack has version 2 idx file), and makes\nthis new mode the default.  The original \"loose objects only\" mode can be\nasked with --quick option.\n\nIn my private git project repository (almost fully packed but with may\ndangling objects) on my AMD 64X2:\n\n    $ /usr/bin/time ./git-fsck --quick\n    0.18user 0.02system 0:00.20elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k\n    0inputs+0outputs (0major+3205minor)pagefaults 0swaps\n\n    $ /usr/bin/time ./git-fsck\n    68.61user 0.43system 1:09.06elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k\n    0inputs+0outputs (0major+116707minor)pagefaults 0swaps\n\n    $ /usr/bin/time ./git-fsck --full\n    90.36user 0.61system 1:31.00elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k\n    0inputs+0outputs (0major+169641minor)pagefaults 0swaps\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin-fsck.c |   13 ++++++++++---\n 1 files changed, 10 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-fsck.c b/builtin-fsck.c\nindex 8dc7881..72bf33b 100644\n--- a/builtin-fsck.c\n+++ b/builtin-fsck.c\n@@ -20,6 +20,7 @@ static int show_tags;\n static int show_unreachable;\n static int include_reflogs = 1;\n static int check_full;\n+static int check_quick;\n static int check_strict;\n static int keep_cache_objects;\n static unsigned char head_sha1[20];\n@@ -576,7 +577,8 @@ static struct option fsck_opts[] = {\n \tOPT_BOOLEAN(0, \"root\", &show_root, \"report root nodes\"),\n \tOPT_BOOLEAN(0, \"cache\", &keep_cache_objects, \"make index objects head nodes\"),\n \tOPT_BOOLEAN(0, \"reflogs\", &include_reflogs, \"make reflogs head nodes (default)\"),\n-\tOPT_BOOLEAN(0, \"full\", &check_full, \"also consider alternate objects\"),\n+\tOPT_BOOLEAN(0, \"full\", &check_full, \"fully check packs\"),\n+\tOPT_BOOLEAN(0, \"quick\", &check_quick, \"only check loose objects\"),\n \tOPT_BOOLEAN(0, \"strict\", &check_strict, \"enable more strict checking\"),\n \tOPT_BOOLEAN(0, \"lost-found\", &write_lost_and_found,\n \t\t\t\t\"write dangling objects in .git/lost-found\"),\n@@ -587,10 +589,14 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)\n {\n \tint i, heads;\n \tstruct alternate_object_database *alt;\n+\tunsigned verify_pack_flag;\n \n \terrors_found = 0;\n \n \targc = parse_options(argc, argv, fsck_opts, fsck_usage, 0);\n+\tif (check_full && check_quick)\n+\t\tdie(\"--full and --quick?  which one do you want?\");\n+\n \tif (write_lost_and_found) {\n \t\tcheck_full = 1;\n \t\tinclude_reflogs = 0;\n@@ -608,13 +614,14 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)\n \t\tfsck_object_dir(namebuf);\n \t}\n \n-\tif (check_full) {\n+\tif (!check_quick) {\n \t\tstruct packed_git *p;\n \n+\t\tverify_pack_flag = check_full ? 0 : VERIFY_PACK_QUICK;\n \t\tprepare_packed_git();\n \t\tfor (p = packed_git; p; p = p->next)\n \t\t\t/* verify gives error messages itself */\n-\t\t\tverify_pack(p, 0);\n+\t\t\tverify_pack(p, verify_pack_flag);\n \n \t\tfor (p = packed_git; p; p = p->next) {\n \t\t\tuint32_t j, num;\n-- \n1.6.1.2.312.g5be3c\n"},{"id":"102567","messageId":"1233313517-24208-6-git-send-email-gitster@pobox.com","threadId":"17455","inReplyTo":"1233313517-24208-5-git-send-email-gitster@pobox.com","subject":"[PATCH 5/5] [squash] fsck: revert --quick to the default and introduce --medium","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-30T11:05:17Z","receivedAt":"2009-01-30T11:05:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"(This commit log message is designed to replace the previous one when\npatch text is squashed into the previous one).\n\nTraditionally, \"git fsck\" only checked loose objects and \"git fsck --full\"\nchecked both loose and packed objects fully.\n\nThis introduces a new medium level of validation that checks loose objects\nand runs the quicker packfile validation introduced earlier (in other\nwords, the individual objects in packfiles are not validated, but we still\nmake sure that the packfiles themselves are sound and individual objects\npass their own CRC checks when the pack has version 2 idx file).\n\nI hoped that the new \"medium\" level to give a cursory look at the pack\ndata would be acceptable as the default, but given the benchmark data,\nI think it is a bit too slow to be the default.  So you pass --medium\nto trigger this new mode, instead of --full.\n\nIn my private git project repository (almost fully packed but with may\ndangling objects) on my AMD 64X2:\n\n    $ /usr/bin/time ./git-fsck\n    0.18user 0.02system 0:00.20elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k\n    0inputs+0outputs (0major+3205minor)pagefaults 0swaps\n\n    $ /usr/bin/time ./git-fsck --medium\n    68.61user 0.43system 1:09.06elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k\n    0inputs+0outputs (0major+116707minor)pagefaults 0swaps\n\n    $ /usr/bin/time ./git-fsck --full\n    90.36user 0.61system 1:31.00elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k\n    0inputs+0outputs (0major+169641minor)pagefaults 0swaps\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin-fsck.c |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin-fsck.c b/builtin-fsck.c\nindex 72bf33b..83faa98 100644\n--- a/builtin-fsck.c\n+++ b/builtin-fsck.c\n@@ -20,7 +20,7 @@ static int show_tags;\n static int show_unreachable;\n static int include_reflogs = 1;\n static int check_full;\n-static int check_quick;\n+static int check_medium;\n static int check_strict;\n static int keep_cache_objects;\n static unsigned char head_sha1[20];\n@@ -578,7 +578,7 @@ static struct option fsck_opts[] = {\n \tOPT_BOOLEAN(0, \"cache\", &keep_cache_objects, \"make index objects head nodes\"),\n \tOPT_BOOLEAN(0, \"reflogs\", &include_reflogs, \"make reflogs head nodes (default)\"),\n \tOPT_BOOLEAN(0, \"full\", &check_full, \"fully check packs\"),\n-\tOPT_BOOLEAN(0, \"quick\", &check_quick, \"only check loose objects\"),\n+\tOPT_BOOLEAN(0, \"medium\", &check_medium, \"also check packs\"),\n \tOPT_BOOLEAN(0, \"strict\", &check_strict, \"enable more strict checking\"),\n \tOPT_BOOLEAN(0, \"lost-found\", &write_lost_and_found,\n \t\t\t\t\"write dangling objects in .git/lost-found\"),\n@@ -594,8 +594,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)\n \terrors_found = 0;\n \n \targc = parse_options(argc, argv, fsck_opts, fsck_usage, 0);\n-\tif (check_full && check_quick)\n-\t\tdie(\"--full and --quick?  which one do you want?\");\n+\tif (check_full && check_medium)\n+\t\tdie(\"--full and --medium?  which one do you want?\");\n \n \tif (write_lost_and_found) {\n \t\tcheck_full = 1;\n@@ -614,7 +614,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)\n \t\tfsck_object_dir(namebuf);\n \t}\n \n-\tif (!check_quick) {\n+\tif (check_full || check_medium) {\n \t\tstruct packed_git *p;\n \n \t\tverify_pack_flag = check_full ? 0 : VERIFY_PACK_QUICK;\n-- \n1.6.1.2.312.g5be3c\n"},{"id":"102574","messageId":"861vulqb1o.fsf@broadpark.no","threadId":"17455","inReplyTo":"1233313517-24208-6-git-send-email-gitster@pobox.com","subject":"Re: [PATCH 5/5] [squash] fsck: revert --quick to the default and introduce --medium","fromName":"Kjetil Barvik","fromEmail":"barvik@broadpark.no","sentAt":"2009-01-30T11:37:55Z","receivedAt":"2009-01-30T11:37:55Z","isPatch":true,"sender":{"key":"barvik@broadpark.no","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> writes:\n<snipp>\n> diff --git a/builtin-fsck.c b/builtin-fsck.c\n> index 72bf33b..83faa98 100644\n> --- a/builtin-fsck.c\n> +++ b/builtin-fsck.c\n> @@ -20,7 +20,7 @@ static int show_tags;\n>  static int show_unreachable;\n>  static int include_reflogs = 1;\n>  static int check_full;\n> -static int check_quick;\n> +static int check_medium;\n>  static int check_strict;\n>  static int keep_cache_objects;\n>  static unsigned char head_sha1[20];\n> @@ -578,7 +578,7 @@ static struct option fsck_opts[] = {\n>  \tOPT_BOOLEAN(0, \"cache\", &keep_cache_objects, \"make index objects head nodes\"),\n>  \tOPT_BOOLEAN(0, \"reflogs\", &include_reflogs, \"make reflogs head nodes (default)\"),\n>  \tOPT_BOOLEAN(0, \"full\", &check_full, \"fully check packs\"),\n> -\tOPT_BOOLEAN(0, \"quick\", &check_quick, \"only check loose objects\"),\n> +\tOPT_BOOLEAN(0, \"medium\", &check_medium, \"also check packs\"),\n>  \tOPT_BOOLEAN(0, \"strict\", &check_strict, \"enable more strict checking\"),\n>  \tOPT_BOOLEAN(0, \"lost-found\", &write_lost_and_found,\n>  \t\t\t\t\"write dangling objects in .git/lost-found\"),\n> @@ -594,8 +594,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)\n>  \terrors_found = 0;\n>  \n>  \targc = parse_options(argc, argv, fsck_opts, fsck_usage, 0);\n> -\tif (check_full && check_quick)\n> -\t\tdie(\"--full and --quick?  which one do you want?\");\n> +\tif (check_full && check_medium)\n> +\t\tdie(\"--full and --medium?  which one do you want?\");\n>  \n\n  Would it not be better to have an \"OPT_INT\" argument named\n  \"check_level\" or similar?\n\n  Then you do not need those error checks, and people would maybe\n  better understand the differences between the different check's?\n\n  The documentation could then say that (for example) \"level 2\n  includes all check's that level 1 includes, in addition to ...\".\n\n  -- kjetil\n"},{"id":"102715","messageId":"20090201064528.6117@nanako3.lavabit.com","threadId":"17455","inReplyTo":"1233313517-24208-2-git-send-email-gitster@pobox.com","subject":"Re: [PATCH 1/5] pack-check.c: minor formatting fix to match coding style","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-01-31T21:45:28Z","receivedAt":"2009-01-31T21:45:28Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Junio C Hamano <gitster@pobox.com>:\n\n> Adjust misaligned columns and multi-line comments that violate our coding\n> style before touching this file.\n>\n> Also fix an obvious typo.\n\nWhat typo did you fix?\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"102724","messageId":"4984CA0C.7010703@trolltech.com","threadId":"17455","inReplyTo":"20090201064528.6117@nanako3.lavabit.com","subject":"Re: [PATCH 1/5] pack-check.c: minor formatting fix to match coding style","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2009-01-31T22:00:44Z","receivedAt":"2009-01-31T22:00:44Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Nanako Shiraishi said the following on 31.01.2009 22:45:\n> Quoting Junio C Hamano <gitster@pobox.com>:\n> \n>> Adjust misaligned columns and multi-line comments that violate our coding\n>> style before touching this file.\n>>\n>> Also fix an obvious typo.\n> \n> What typo did you fix?\n\n-\t\terr = error(\"%s SHA1 does not match its inddex\",\n+\t\terr = error(\"%s SHA1 does not match its index\",\n\n--\n.marius\n"},{"id":"102728","messageId":"20090201095258.6117@nanako3.lavabit.com","threadId":"17455","inReplyTo":"4984CA0C.7010703@trolltech.com","subject":"Re: [PATCH 1/5] pack-check.c: minor formatting fix to match coding style","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-02-01T00:52:58Z","receivedAt":"2009-02-01T00:52:58Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Marius Storm-Olsen <marius@trolltech.com>:\n\n>Nanako Shiraishi said the following on 31.01.2009 22:45:\n>> What typo did you fix?\n>\n>-\t\terr = error(\"%s SHA1 does not match its inddex\",\n>+\t\terr = error(\"%s SHA1 does not match its index\",\n\nAh, you are right. Sorry for the noise.\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"}]}