{"thread":{"id":"13746","subject":"[PATCH] Honor git-reset -q by silencing progress updates.","startedAt":"2008-05-31T21:41:54Z","lastAt":"2008-05-31T22:43:59Z","messageCount":2,"participants":["Jamis Buck","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"78247","messageId":"32206B67-D97A-459E-BA48-D3B343D775F3@37signals.com","threadId":"13746","inReplyTo":null,"subject":"[PATCH] Honor git-reset -q by silencing progress updates.","fromName":"Jamis Buck","fromEmail":"jamis@37signals.com","sentAt":"2008-05-31T21:41:54Z","receivedAt":"2008-05-31T21:41:54Z","isPatch":true,"sender":{"key":"jamis@37signals.com","avatar":null},"body":"When running git-reset in a non-interactive setting, the -q switch\nworks for everything except the progress updates. This patch attempts\nto extend the application of -q to suppress that, too.\n---\nbuiltin-reset.c |    9 +++++----\n1 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-reset.c b/builtin-reset.c\nindex e32ddd9..3810f6d 100644\n--- a/builtin-reset.c\n+++ b/builtin-reset.c\n@@ -49,13 +49,14 @@ static inline int is_merge(void)\n\treturn !access(git_path(\"MERGE_HEAD\"), F_OK);\n}\n\n-static int reset_index_file(const unsigned char *sha1, int  \nis_hard_reset)\n+static int reset_index_file(const unsigned char *sha1, int  \nis_hard_reset, int quiet)\n{\n\tint i = 0;\n\tconst char *args[6];\n\n\targs[i++] = \"read-tree\";\n-\targs[i++] = \"-v\";\n+\tif (!quiet)\n+\t\targs[i++] = \"-v\";\n\targs[i++] = \"--reset\";\n\tif (is_hard_reset)\n\t\targs[i++] = \"-u\";\n@@ -182,7 +183,7 @@ int cmd_reset(int argc, const char **argv, const  \nchar *prefix)\n\t\tOPT_SET_INT(0, \"hard\", &reset_type,\n\t\t\t\t\"reset HEAD, index and working tree\", HARD),\n\t\tOPT_BOOLEAN('q', NULL, &quiet,\n-\t\t\t\t\"disable showing new HEAD in hard reset\"),\n+\t\t\t\t\"disable progress and showing new HEAD in hard reset\"),\n\t\tOPT_END()\n\t};\n\n@@ -231,7 +232,7 @@ int cmd_reset(int argc, const char **argv, const  \nchar *prefix)\n\t\tif (is_merge() || read_cache() < 0 || unmerged_cache())\n\t\t\tdie(\"Cannot do a soft reset in the middle of a merge.\");\n\t}\n-\telse if (reset_index_file(sha1, (reset_type == HARD)))\n+\telse if (reset_index_file(sha1, (reset_type == HARD), quiet))\n\t\tdie(\"Could not reset index file to revision '%s'.\", rev);\n\n\t/* Any resets update HEAD to the head being switched to,\n-- \n1.5.5.1\n\n"},{"id":"78254","messageId":"7vej7idrgw.fsf@gitster.siamese.dyndns.org","threadId":"13746","inReplyTo":"32206B67-D97A-459E-BA48-D3B343D775F3@37signals.com","subject":"Re: [PATCH] Honor git-reset -q by silencing progress updates.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-31T22:43:59Z","receivedAt":"2008-05-31T22:43:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jamis Buck <jamis@37signals.com> writes:\n\n> --Apple-Mail-10--112802933\n> Content-Type: text/plain;\n> \tcharset=US-ASCII;\n> \tformat=flowed;\n> \tdelsp=yes\n> Content-Transfer-Encoding: 7bit\n\nPlease do not do unnecessary S/MIME nor format=flawed.  It makes reviewing\nand application of the patches inconvenient.\n\n>\n> When running git-reset in a non-interactive setting, the -q switch\n> works for everything except the progress updates. This patch attempts\n> to extend the application of -q to suppress that, too.\n> ---\n> builtin-reset.c |    9 +++++----\n> 1 files changed, 5 insertions(+), 4 deletions(-)\n>\n> diff --git a/builtin-reset.c b/builtin-reset.c\n> index e32ddd9..3810f6d 100644\n> --- a/builtin-reset.c\n> +++ b/builtin-reset.c\n> @@ -49,13 +49,14 @@ static inline int is_merge(void)\n> \treturn !access(git_path(\"MERGE_HEAD\"), F_OK);\n> }\n>\n> -static int reset_index_file(const unsigned char *sha1, int  \n> is_hard_reset)\n> +static int reset_index_file(const unsigned char *sha1, int  \n> is_hard_reset, int quiet)\n> {\n"}]}