gc: Add --quiet option
Pass -q option to git-repack. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Frank Lichtenheld committed
Feb 29, 2008 at 22:53 UTC
a0c14cbb2eebaa86b57ef797d0a03b836a817dd5
2 files changed
+8
-1
Documentation/git-gc.txt
+4
-1
@@ -8,7 +8,7 @@ git-gc - Cleanup unnecessary files and optimize the local repository
8
9
SYNOPSIS
10
--------
11
-'git-gc' [--prune] [--aggressive] [--auto]
11
+'git-gc' [--prune] [--aggressive] [--auto] [--quiet]
12
13
DESCRIPTION
14
-----------
@@ -63,6 +63,9 @@ are consolidated into a single pack by using the `-A` option of
63
`git-repack`. Setting `gc.autopacklimit` to 0 disables
64
automatic consolidation of packs.
65
66
+--quiet::
67
+ Suppress all progress reports.
68
+
69
Configuration
70
-------------
71
builtin-gc.c
+4
@@ -172,12 +172,14 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
172
int prune = 0;
173
int aggressive = 0;
174
int auto_gc = 0;
175
+ int quiet = 0;
176
char buf[80];
177
178
struct option builtin_gc_options[] = {
179
OPT_BOOLEAN(0, "prune", &prune, "prune unreferenced objects"),
180
OPT_BOOLEAN(0, "aggressive", &aggressive, "be more thorough (increased runtime)"),
181
OPT_BOOLEAN(0, "auto", &auto_gc, "enable auto-gc mode"),
182
+ OPT_BOOLEAN('q', "quiet", &quiet, "suppress progress reports"),
183
OPT_END()
184
};
185
@@ -197,6 +199,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
199
append_option(argv_repack, buf, MAX_ADD);
200
}
201
}
202
+ if (quiet)
203
+ append_option(argv_repack, "-q", MAX_ADD);
204
205
if (auto_gc) {
206
/*