Skip to content

Commit

Permalink
gc: Add --quiet option
Browse files Browse the repository at this point in the history
Pass -q option to git-repack.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Frank Lichtenheld authored and Junio C Hamano committed Mar 1, 2008
1 parent dfb9a34 commit a0c14cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Documentation/git-gc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ git-gc - Cleanup unnecessary files and optimize the local repository

SYNOPSIS
--------
'git-gc' [--prune] [--aggressive] [--auto]
'git-gc' [--prune] [--aggressive] [--auto] [--quiet]

DESCRIPTION
-----------
Expand Down Expand Up @@ -63,6 +63,9 @@ are consolidated into a single pack by using the `-A` option of
`git-repack`. Setting `gc.autopacklimit` to 0 disables
automatic consolidation of packs.

--quiet::
Suppress all progress reports.

Configuration
-------------

Expand Down
4 changes: 4 additions & 0 deletions builtin-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,14 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
int prune = 0;
int aggressive = 0;
int auto_gc = 0;
int quiet = 0;
char buf[80];

struct option builtin_gc_options[] = {
OPT_BOOLEAN(0, "prune", &prune, "prune unreferenced objects"),
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()
};

Expand All @@ -197,6 +199,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
append_option(argv_repack, buf, MAX_ADD);
}
}
if (quiet)
append_option(argv_repack, "-q", MAX_ADD);

if (auto_gc) {
/*
Expand Down

0 comments on commit a0c14cb

Please sign in to comment.