Skip to content

Commit a0c14cb

Browse files
flichtenheldgitster
authored andcommitted
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>
1 parent dfb9a34 commit a0c14cb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Documentation/git-gc.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ git-gc - Cleanup unnecessary files and optimize the local repository
88

99
SYNOPSIS
1010
--------
11-
'git-gc' [--prune] [--aggressive] [--auto]
11+
'git-gc' [--prune] [--aggressive] [--auto] [--quiet]
1212

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

66+
--quiet::
67+
Suppress all progress reports.
68+
6669
Configuration
6770
-------------
6871

builtin-gc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,14 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
172172
int prune = 0;
173173
int aggressive = 0;
174174
int auto_gc = 0;
175+
int quiet = 0;
175176
char buf[80];
176177

177178
struct option builtin_gc_options[] = {
178179
OPT_BOOLEAN(0, "prune", &prune, "prune unreferenced objects"),
179180
OPT_BOOLEAN(0, "aggressive", &aggressive, "be more thorough (increased runtime)"),
180181
OPT_BOOLEAN(0, "auto", &auto_gc, "enable auto-gc mode"),
182+
OPT_BOOLEAN('q', "quiet", &quiet, "suppress progress reports"),
181183
OPT_END()
182184
};
183185

@@ -197,6 +199,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
197199
append_option(argv_repack, buf, MAX_ADD);
198200
}
199201
}
202+
if (quiet)
203+
append_option(argv_repack, "-q", MAX_ADD);
200204

201205
if (auto_gc) {
202206
/*

0 commit comments

Comments
 (0)