{"thread":{"id":"12388","subject":"[PATCH] gc: Add --quiet option","startedAt":"2008-02-29T21:53:39Z","lastAt":"2008-03-01T20:24:55Z","messageCount":2,"participants":["Frank Lichtenheld","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"70433","messageId":"1204322019-17788-1-git-send-email-frank@lichtenheld.de","threadId":"12388","inReplyTo":null,"subject":"[PATCH] gc: Add --quiet option","fromName":"Frank Lichtenheld","fromEmail":"frank@lichtenheld.de","sentAt":"2008-02-29T21:53:39Z","receivedAt":"2008-02-29T21:53:39Z","isPatch":true,"sender":{"key":"frank@lichtenheld.de","avatar":"https://gravatar.com/avatar/b9f1d4b120e138f157c9e480d0818197c474628923786adb98f30017cdb99c3c?d=mp&s=160"},"body":"Pass -q option to git-repack.\n\nSigned-off-by: Frank Lichtenheld <frank@lichtenheld.de>\n---\n Documentation/git-gc.txt |    5 ++++-\n builtin-gc.c             |    5 +++++\n 2 files changed, 9 insertions(+), 1 deletions(-)\n\nI've decided to support -q since all other git commands that support --quiet\nseem to support it, and many only support -q, but not --quiet.\nIt is currently not documented, though.\n\ndiff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt\nindex 4b2dfef..310710a 100644\n--- a/Documentation/git-gc.txt\n+++ b/Documentation/git-gc.txt\n@@ -8,7 +8,7 @@ git-gc - Cleanup unnecessary files and optimize the local repository\n \n SYNOPSIS\n --------\n-'git-gc' [--prune] [--aggressive] [--auto]\n+'git-gc' [--prune] [--aggressive] [--auto] [--quiet]\n \n DESCRIPTION\n -----------\n@@ -49,6 +49,9 @@ OPTIONS\n \trequired; if not, it exits without performing any work.\n \tSome git commands run `git gc --auto` after performing\n \toperations that could create many loose objects.\n+\n+--quiet::\n+\tSuppress all progress reports.\n +\n Housekeeping is required if there are too many loose objects or\n too many packs in the repository. If the number of loose objects\ndiff --git a/builtin-gc.c b/builtin-gc.c\nindex ad4a75e..3a42986 100644\n--- a/builtin-gc.c\n+++ b/builtin-gc.c\n@@ -172,12 +172,14 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \tint prune = 0;\n \tint aggressive = 0;\n \tint auto_gc = 0;\n+\tint quiet = 0;\n \tchar buf[80];\n \n \tstruct option builtin_gc_options[] = {\n \t\tOPT_BOOLEAN(0, \"prune\", &prune, \"prune unreferenced objects\"),\n \t\tOPT_BOOLEAN(0, \"aggressive\", &aggressive, \"be more thorough (increased runtime)\"),\n \t\tOPT_BOOLEAN(0, \"auto\", &auto_gc, \"enable auto-gc mode\"),\n+\t\tOPT_BOOLEAN('q', \"quiet\", &quiet, \"suppress progress reports\"),\n \t\tOPT_END()\n \t};\n \n@@ -197,6 +199,9 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\t\tappend_option(argv_repack, buf, MAX_ADD);\n \t\t}\n \t}\n+\tif (quiet) {\n+\t\tappend_option(argv_repack, \"-q\", MAX_ADD);\n+\t}\n \n \tif (auto_gc) {\n \t\t/*\n-- \n1.5.4.3\n\n"},{"id":"70552","messageId":"7v4pbqyyy0.fsf@gitster.siamese.dyndns.org","threadId":"12388","inReplyTo":"1204322019-17788-1-git-send-email-frank@lichtenheld.de","subject":"Re: [PATCH] gc: Add --quiet option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-01T20:24:55Z","receivedAt":"2008-03-01T20:24:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Frank Lichtenheld <frank@lichtenheld.de> writes:\n\n> @@ -49,6 +49,9 @@ OPTIONS\n>  \trequired; if not, it exits without performing any work.\n>  \tSome git commands run `git gc --auto` after performing\n>  \toperations that could create many loose objects.\n> +\n> +--quiet::\n> +\tSuppress all progress reports.\n>  +\n>  Housekeeping is required if there are too many loose objects or\n>  too many packs in the repository. If the number of loose objects\n\nRead the surrounding text again.  \"Housekeeping is...\" is talking about\nthe --auto option.\n\nI'll move the description of --quiet a bit down.\n\n> @@ -197,6 +199,9 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n>  \t\t\tappend_option(argv_repack, buf, MAX_ADD);\n>  \t\t}\n>  \t}\n> +\tif (quiet) {\n> +\t\tappend_option(argv_repack, \"-q\", MAX_ADD);\n> +\t}\n\nNo { } around a single statement.\n\nNo need to resend, as I've already munged your patch and applied.\n\nThanks.\n"}]}