{"thread":{"id":"37347","subject":"[PATCH 2/2] fetch: silence git-gc if --quiet is given","startedAt":"2014-08-14T11:51:04Z","lastAt":"2014-08-16T01:19:28Z","messageCount":7,"participants":["Nguyễn Thái Ngọc Duy","Jeff King","Duy Nguyen"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"247717","messageId":"1408017065-17437-1-git-send-email-pclouds@gmail.com","threadId":"37347","inReplyTo":null,"subject":"[PATCH 1/2] fetch: convert argv_gc_auto to struct argv_array","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2014-08-14T11:51:04Z","receivedAt":"2014-08-14T11:51:04Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/fetch.c | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex e8d0cca..9394194 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -1110,9 +1110,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \tstruct string_list list = STRING_LIST_INIT_NODUP;\n \tstruct remote *remote;\n \tint result = 0;\n-\tstatic const char *argv_gc_auto[] = {\n-\t\t\"gc\", \"--auto\", NULL,\n-\t};\n+\tstruct argv_array argv_gc_auto = ARGV_ARRAY_INIT;\n \n \tpacket_trace_identity(\"fetch\");\n \n@@ -1198,7 +1196,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \tlist.strdup_strings = 1;\n \tstring_list_clear(&list, 0);\n \n-\trun_command_v_opt(argv_gc_auto, RUN_GIT_CMD);\n+\targv_array_pushl(&argv_gc_auto, \"gc\", \"--auto\", NULL);\n+\trun_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);\n \n \treturn result;\n }\n-- \n2.1.0.rc0.78.gc0d8480\n"},{"id":"247716","messageId":"1408017065-17437-2-git-send-email-pclouds@gmail.com","threadId":"37347","inReplyTo":"1408017065-17437-1-git-send-email-pclouds@gmail.com","subject":"[PATCH 2/2] fetch: silence git-gc if --quiet is given","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2014-08-14T11:51:05Z","receivedAt":"2014-08-14T11:51:05Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Noticed-by: Matthew Flaschen <mflaschen@wikimedia.org>\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/fetch.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 9394194..4ff4080 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -1197,6 +1197,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \tstring_list_clear(&list, 0);\n \n \targv_array_pushl(&argv_gc_auto, \"gc\", \"--auto\", NULL);\n+\tif (verbosity < 0)\n+\t\targv_array_push(&argv_gc_auto,\"--quiet\");\n \trun_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);\n \n \treturn result;\n-- \n2.1.0.rc0.78.gc0d8480\n"},{"id":"247727","messageId":"20140814195320.GA19337@peff.net","threadId":"37347","inReplyTo":"1408017065-17437-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 1/2] fetch: convert argv_gc_auto to struct argv_array","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-08-14T19:53:20Z","receivedAt":"2014-08-14T19:53:20Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Aug 14, 2014 at 06:51:04PM +0700, Nguyễn Thái Ngọc Duy wrote:\n\n> -\tstatic const char *argv_gc_auto[] = {\n> -\t\t\"gc\", \"--auto\", NULL,\n> -\t};\n> +\tstruct argv_array argv_gc_auto = ARGV_ARRAY_INIT;\n>  \n>  \tpacket_trace_identity(\"fetch\");\n>  \n> @@ -1198,7 +1196,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n>  \tlist.strdup_strings = 1;\n>  \tstring_list_clear(&list, 0);\n>  \n> -\trun_command_v_opt(argv_gc_auto, RUN_GIT_CMD);\n> +\targv_array_pushl(&argv_gc_auto, \"gc\", \"--auto\", NULL);\n> +\trun_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);\n\nargv_array_clear() here afterwards?\n\nNot a huge deal since we are about to exit, but in the name of\ngood hygiene.\n\n-Peff\n"},{"id":"247728","messageId":"20140814195615.GB19337@peff.net","threadId":"37347","inReplyTo":"1408017065-17437-2-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 2/2] fetch: silence git-gc if --quiet is given","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-08-14T19:56:15Z","receivedAt":"2014-08-14T19:56:15Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Aug 14, 2014 at 06:51:05PM +0700, Nguyễn Thái Ngọc Duy wrote:\n\n> Noticed-by: Matthew Flaschen <mflaschen@wikimedia.org>\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  builtin/fetch.c | 2 ++\n>  1 file changed, 2 insertions(+)\n> \n> diff --git a/builtin/fetch.c b/builtin/fetch.c\n> index 9394194..4ff4080 100644\n> --- a/builtin/fetch.c\n> +++ b/builtin/fetch.c\n> @@ -1197,6 +1197,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n>  \tstring_list_clear(&list, 0);\n>  \n>  \targv_array_pushl(&argv_gc_auto, \"gc\", \"--auto\", NULL);\n> +\tif (verbosity < 0)\n> +\t\targv_array_push(&argv_gc_auto,\"--quiet\");\n>  \trun_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);\n\nI think this is a fine fix for this specific problem, and we should\napply it. But I do wonder if it would be simpler in the long run to\ntreat verbosity as a global option, and pass it around via a GIT_QUIET\n(or GIT_VERBOSITY) environment variable.\n\nI would not be surprised at all to find that there are other cases where\nsub-programs do not respect the parent verbosity (I know we have had\nproblems with progress reporting flags carried over the transport\ninterface in the past, but I think we fixed all of those).\n\n-Peff\n"},{"id":"247739","messageId":"CACsJy8CuiAYGA-Tkr1p+KVm=hvpKYwooJMc9-z-pR4nOBDaTug@mail.gmail.com","threadId":"37347","inReplyTo":"20140814195615.GB19337@peff.net","subject":"Re: [PATCH 2/2] fetch: silence git-gc if --quiet is given","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2014-08-15T12:09:55Z","receivedAt":"2014-08-15T12:09:55Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, Aug 15, 2014 at 2:56 AM, Jeff King <peff@peff.net> wrote:\n> I think this is a fine fix for this specific problem, and we should\n> apply it. But I do wonder if it would be simpler in the long run to\n> treat verbosity as a global option, and pass it around via a GIT_QUIET\n> (or GIT_VERBOSITY) environment variable.\n>\n> I would not be surprised at all to find that there are other cases where\n> sub-programs do not respect the parent verbosity (I know we have had\n> problems with progress reporting flags carried over the transport\n> interface in the past, but I think we fixed all of those).\n\nI don't see any easy way to make everybody aware of $GIT_QUIET. But\nthe idea is nice.\n-- \nDuy\n"},{"id":"247763","messageId":"1408151968-30294-1-git-send-email-pclouds@gmail.com","threadId":"37347","inReplyTo":"1408017065-17437-1-git-send-email-pclouds@gmail.com","subject":"[PATCH v2 1/2] fetch: convert argv_gc_auto to struct argv_array","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2014-08-16T01:19:27Z","receivedAt":"2014-08-16T01:19:27Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/fetch.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex e8d0cca..5f06114 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -1110,9 +1110,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \tstruct string_list list = STRING_LIST_INIT_NODUP;\n \tstruct remote *remote;\n \tint result = 0;\n-\tstatic const char *argv_gc_auto[] = {\n-\t\t\"gc\", \"--auto\", NULL,\n-\t};\n+\tstruct argv_array argv_gc_auto = ARGV_ARRAY_INIT;\n \n \tpacket_trace_identity(\"fetch\");\n \n@@ -1198,7 +1196,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \tlist.strdup_strings = 1;\n \tstring_list_clear(&list, 0);\n \n-\trun_command_v_opt(argv_gc_auto, RUN_GIT_CMD);\n+\targv_array_pushl(&argv_gc_auto, \"gc\", \"--auto\", NULL);\n+\trun_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);\n+\targv_array_clear(&argv_gc_auto);\n \n \treturn result;\n }\n-- \n2.1.0.rc0.78.gc0d8480\n"},{"id":"247764","messageId":"1408151968-30294-2-git-send-email-pclouds@gmail.com","threadId":"37347","inReplyTo":"1408151968-30294-1-git-send-email-pclouds@gmail.com","subject":"[PATCH v2 2/2] fetch: silence git-gc if --quiet is given","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2014-08-16T01:19:28Z","receivedAt":"2014-08-16T01:19:28Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Noticed-by: Matthew Flaschen <mflaschen@wikimedia.org>\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/fetch.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 5f06114..159fb7e 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -1197,6 +1197,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \tstring_list_clear(&list, 0);\n \n \targv_array_pushl(&argv_gc_auto, \"gc\", \"--auto\", NULL);\n+\tif (verbosity < 0)\n+\t\targv_array_push(&argv_gc_auto, \"--quiet\");\n \trun_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);\n \targv_array_clear(&argv_gc_auto);\n \n-- \n2.1.0.rc0.78.gc0d8480\n"}]}