Re: [PATCH 5/5] [squash] fsck: revert --quick to the default and introduce --medium
- From
- Kjetil Barvik <barvik@broadpark.no>
- Date
- Jan 30, 2009, 11:37 UTC
- Message-ID
- <861vulqb1o.fsf@broadpark.no>
- In-Reply-To
- <1233313517-24208-6-git-send-email-gitster@pobox.com>
Junio C Hamano <gitster@pobox.com> writes: <snipp>
Show 31 quoted lines
> diff --git a/builtin-fsck.c b/builtin-fsck.c
> index 72bf33b..83faa98 100644
> --- a/builtin-fsck.c
> +++ b/builtin-fsck.c
> @@ -20,7 +20,7 @@ static int show_tags;
> static int show_unreachable;
> static int include_reflogs = 1;
> static int check_full;
> -static int check_quick;
> +static int check_medium;
> static int check_strict;
> static int keep_cache_objects;
> static unsigned char head_sha1[20];
> @@ -578,7 +578,7 @@ static struct option fsck_opts[] = {
> 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, "fully check packs"),
> - OPT_BOOLEAN(0, "quick", &check_quick, "only check loose objects"),
> + OPT_BOOLEAN(0, "medium", &check_medium, "also check packs"),
> 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"),
> @@ -594,8 +594,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
> errors_found = 0;
>
> argc = parse_options(argc, argv, fsck_opts, fsck_usage, 0);
> - if (check_full && check_quick)
> - die("--full and --quick? which one do you want?");
> + if (check_full && check_medium)
> + die("--full and --medium? which one do you want?");
> Would it not be better to have an "OPT_INT" argument named "check_level" or similar?
Then you do not need those error checks, and people would maybe better understand the differences between the different check's?
The documentation could then say that (for example) "level 2 includes all check's that level 1 includes, in addition to ...".
-- kjetil