{"thread":{"id":"35153","subject":"Pull and fetch don't honor `--progress` flag","startedAt":"2013-10-16T19:50:51Z","lastAt":"2013-10-16T21:27:09Z","messageCount":3,"participants":["Jacobs, Todd","John Keeping"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"229082","messageId":"48AC4CE6F0887542B2A5E28E4E7A929740FA5349A9@Viper-RSG.pc.cognex.com","threadId":"35153","inReplyTo":null,"subject":"Pull and fetch don't honor `--progress` flag","fromName":"Jacobs, Todd","fromEmail":"todd.jacobs@cognex.com","sentAt":"2013-10-16T19:50:51Z","receivedAt":"2013-10-16T19:50:51Z","isPatch":false,"sender":{"key":"todd.jacobs@cognex.com","avatar":null},"body":"When I use the `--progress` flag with the push command, I get transfer-speed statistics like this:\n\n    $ git push -progress origin master 2>&1 | tee /tmp/push\n    Counting objects: 30, done.\n    Compressing objects: 100% (20/20), done.\n    Writing objects: 100% (30/30), 9.02 MiB | 206.00 KiB/s, done.\n    Total 30 (delta 0), reused 0 (delta 0)\n\nThis also works similarly with clone:\n\n    $ git clone --progress \"$url\" foo.git 2>&1 | tee /tmp/clone\n    Cloning into 'foo.git'...\n    remote: Counting objects: 61, done.\n    remote: Compressing objects: 100% (43/43), done.\n    remote: Total 61 (delta 3), reused 0 (delta 0)\n    Receiving objects: 100% (61/61), 15.22 MiB | 473.00 KiB/s, done.\n    Resolving deltas: 100% (3/3), done.\n    Checking connectivity... done\n\nHowever, even though pull and fetch also have the same flag documented, git never reports any network statistics at all. For example:\n\n    $ git pull --progress origin master 2>&1 | tee /tmp/pull\n    remote: Counting objects: 5, done.\n    remote: Compressing objects: 100% (3/3), done.\n    remote: Total 3 (delta 1), reused 0 (delta 0)\n\nThis is repeatable with both Git 1.7.9 and Git 1.8.4.1 running under Cygwin. Is this a bug? If not, how can I make fetch and pull cough up throughput statistics?\n"},{"id":"229086","messageId":"20131016201210.GR27238@serenity.lan","threadId":"35153","inReplyTo":"48AC4CE6F0887542B2A5E28E4E7A929740FA5349A9@Viper-RSG.pc.cognex.com","subject":"Re: Pull and fetch don't honor `--progress` flag","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-10-16T20:12:10Z","receivedAt":"2013-10-16T20:12:10Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Wed, Oct 16, 2013 at 03:50:51PM -0400, Jacobs, Todd wrote:\n> When I use the `--progress` flag with the push command, I get transfer-speed statistics like this:\n> \n>     $ git push -progress origin master 2>&1 | tee /tmp/push\n>     Counting objects: 30, done.\n>     Compressing objects: 100% (20/20), done.\n>     Writing objects: 100% (30/30), 9.02 MiB | 206.00 KiB/s, done.\n>     Total 30 (delta 0), reused 0 (delta 0)\n> \n> This also works similarly with clone:\n> \n>     $ git clone --progress \"$url\" foo.git 2>&1 | tee /tmp/clone\n>     Cloning into 'foo.git'...\n>     remote: Counting objects: 61, done.\n>     remote: Compressing objects: 100% (43/43), done.\n>     remote: Total 61 (delta 3), reused 0 (delta 0)\n>     Receiving objects: 100% (61/61), 15.22 MiB | 473.00 KiB/s, done.\n>     Resolving deltas: 100% (3/3), done.\n>     Checking connectivity... done\n> \n> However, even though pull and fetch also have the same flag documented, git never reports any network statistics at all. For example:\n> \n>     $ git pull --progress origin master 2>&1 | tee /tmp/pull\n>     remote: Counting objects: 5, done.\n>     remote: Compressing objects: 100% (3/3), done.\n>     remote: Total 3 (delta 1), reused 0 (delta 0)\n> \n> This is repeatable with both Git 1.7.9 and Git 1.8.4.1 running under Cygwin. Is this a bug? If not, how can I make fetch and pull cough up throughput statistics?\n\nDoes it make a difference how you invoke \"git fetch\"?  From a quick look\nat the code, \"git fetch\" with no remote or refspec should display\nprogress data, but if you specify \"--all\" or a remote and refspec then\nit won't.\n\nThe following patch (untested) will fix it if that is the case:\n\n-- >8 --\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex bd7a101..487381e 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -952,6 +952,10 @@ static void add_options_to_argv(struct argv_array *argv)\n \t\targv_array_push(argv, \"-v\");\n \telse if (verbosity < 0)\n \t\targv_array_push(argv, \"-q\");\n+\tif (progress > 0)\n+\t\targv_array_push(argv, \"--progress\");\n+\telse if (progress == 0)\n+\t\targv_array_push(argv, \"--no-progress\");\n \n }\n \n"},{"id":"229087","messageId":"48AC4CE6F0887542B2A5E28E4E7A929740FA5349B8@Viper-RSG.pc.cognex.com","threadId":"35153","inReplyTo":"20131016201210.GR27238@serenity.lan","subject":"RE: Pull and fetch don't honor `--progress` flag","fromName":"Jacobs, Todd","fromEmail":"todd.jacobs@cognex.com","sentAt":"2013-10-16T21:27:09Z","receivedAt":"2013-10-16T21:27:09Z","isPatch":false,"sender":{"key":"todd.jacobs@cognex.com","avatar":null},"body":"> Does it make a difference how you invoke \"git fetch\"?  From a quick look at\n> the code, \"git fetch\" with no remote or refspec should display progress data,\n> but if you specify \"--all\" or a remote and refspec then it won't.\n\nThanks for your prompt response.  However, it doesn't make any\ndifference.  The behavior remains the same even without specifying\na refspec.  For example:\n\n    $ git pull\n    remote: Counting objects: 5, done.\n    remote: Compressing objects: 100% (3/3), done.\n    remote: Total 3 (delta 1), reused 0 (delta 0)\n    Unpacking objects: 100% (3/3), done.\n\n    $ git fetch\n    remote: Counting objects: 5, done.\n    remote: Compressing objects: 100% (3/3), done.\n    remote: Total 3 (delta 1), reused 0 (delta 0)\n    Unpacking objects: 100% (3/3), done. \n"}]}