X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=builtin-gc.c;h=c304638b7845601f184149d3c48cbc1ea1e195f5;hb=84f88512aa5067687d226a239810f6da952673b5;hp=fc556ed7f3fb68734fd783e5b38e6b050bed9c5b;hpb=011c181cc656c8b3e48882729d1b6238e8c5c537;p=git.git diff --git a/builtin-gc.c b/builtin-gc.c index fc556ed7f..c304638b7 100644 --- a/builtin-gc.c +++ b/builtin-gc.c @@ -180,12 +180,12 @@ int cmd_gc(int argc, const char **argv, const char *prefix) char buf[80]; struct option builtin_gc_options[] = { + OPT__QUIET(&quiet), { OPTION_STRING, 0, "prune", &prune_expire, "date", "prune unreferenced objects", PARSE_OPT_OPTARG, NULL, (intptr_t)prune_expire }, OPT_BOOLEAN(0, "aggressive", &aggressive, "be more thorough (increased runtime)"), OPT_BOOLEAN(0, "auto", &auto_gc, "enable auto-gc mode"), - OPT_BOOLEAN('q', "quiet", &quiet, "suppress progress reports"), OPT_END() }; @@ -194,7 +194,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix) if (pack_refs < 0) pack_refs = !is_bare_repository(); - argc = parse_options(argc, argv, builtin_gc_options, builtin_gc_usage, 0); + argc = parse_options(argc, argv, prefix, builtin_gc_options, + builtin_gc_usage, 0); if (argc > 0) usage_with_options(builtin_gc_usage, builtin_gc_options); @@ -215,10 +216,13 @@ int cmd_gc(int argc, const char **argv, const char *prefix) */ if (!need_to_gc()) return 0; - fprintf(stderr, "Auto packing your repository for optimum " - "performance. You may also\n" - "run \"git gc\" manually. See " - "\"git help gc\" for more information.\n"); + fprintf(stderr, + "Auto packing the repository for optimum performance.%s\n", + quiet + ? "" + : (" You may also\n" + "run \"git gc\" manually. See " + "\"git help gc\" for more information.")); } else append_option(argv_repack, prune_expire && !strcmp(prune_expire, "now")