{"thread":{"id":"52820","subject":"Bug: Git: Clone: University Network: No Output on Terminal","startedAt":"2020-02-17T08:02:58Z","lastAt":"2020-02-20T16:07:16Z","messageCount":7,"participants":["Manish Devgan","brian m. carlson","René Scharfe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"391898","messageId":"CABVXwf6q1xMFhw+xd5f8GKATwC9k8mrXUkykpGgvTj7hv9pwEw@mail.gmail.com","threadId":"52820","inReplyTo":null,"subject":"Bug: Git: Clone: University Network: No Output on Terminal","fromName":"Manish Devgan","fromEmail":"manish.nsit8@gmail.com","sentAt":"2020-02-17T08:02:44Z","receivedAt":"2020-02-17T08:02:58Z","isPatch":false,"sender":{"key":"manish.nsit8@gmail.com","avatar":"https://gravatar.com/avatar/9248ecb21f4053d8d84f454840d7f0bfa8aa8aa9d73bd88d0f53a58cd2e7dc1b?d=mp&s=160"},"body":"Hello,\n\nI am a university student from India and I was trying to clone the\nxfwm4 git repository from the git-url :\nhttps://git.xfce.org/xfce/xfwm4\nI was trying to clone this repository over my university network and\nit didn't work. I worked my way around by using my mobile\nwireless-hotspot for the same and was able to do it just fine.\nThe next day I tried doing the exact same thing since I couldn't get\nan answer from our university if any such firewall was blocking me\nfrom cloning it. But this time instead of failing to reach the url the\ncommand ran with the following output:\n\ngabru-md@bhaalu:~/Desktop$ git clone https://git.xfce.org/xfce/xfwm4\nCloning into 'xfwm4'...\n\nafter waiting for a few minutes the command didn't fail but it didn't\nshow any output/stats like it does when I try to clone a repository\nfrom Github which is definitely not blocked on the university network.\nfor eg.\n\ngabru-md@bhaalu:~/Desktop$ git clone https://github.com/gabru-md/stl-cpp\nCloning into 'stl-cpp'...\nremote: Enumerating objects: 186, done.\nremote: Counting objects: 100% (186/186), done.\nremote: Compressing objects: 100% (128/128), done.\nremote: Total 186 (delta 92), reused 146 (delta 56), pack-reused 0\nReceiving objects: 100% (186/186), 105.58 KiB | 256.00 KiB/s, done.\nResolving deltas: 100% (92/92), done.\n\nFurthermore the interesting thing is that I expected that my attempt\nat cloning the xfwm4 repository might have failed but it surprisingly\ndid not. The command did clone the xfwm4 repository for me but it\ndidn't print out any stats/output during that time.\n\nAfter searching on DuckDuckGo I saw that adding flags `--verbose\n--progress` will allow me to achieve the desired functionality. I\ntried doing the same and the output is given below.\n\ngabru-md@bhaalu:~/Desktop/test$ git clone --progress --verbose\nhttps://git.xfce.org/xfce/xfwm4\nCloning into 'xfwm4'...\ngabru-md@bhaalu:~/Desktop/test$ ls\nxfwm4\ngabru-md@bhaalu:~/Desktop/test$ cd xfwm4/\ngabru-md@bhaalu:~/Desktop/test/xfwm4$ cd icons/\ngabru-md@bhaalu:~/Desktop/test/xfwm4/icons$ ls\n22x22  48x48  Makefile.am  scalable\n\nIt is evident that the cloning worked perfectly fine but there didn't\nseem to be any output on the terminal. At first I was convinced that\nit was network error because it couldn't reach the target url but now\nit doesn't seem to be a network problem.\n\nI am not quite sure if this unfamiliar behavior while cloning a\nrepository is a bug or not hence I thought of reporting it. Also,\nApologies if this is not a bug but something which is known already.\n\nI am currently running git version 2.17.1 on my Xubuntu.\n\n\nThanks and Regards\nManish Devgan\nmanish.nsit8@gmail.com\n"},{"id":"391938","messageId":"20200217172954.GH6134@camp.crustytoothpaste.net","threadId":"52820","inReplyTo":"CABVXwf6q1xMFhw+xd5f8GKATwC9k8mrXUkykpGgvTj7hv9pwEw@mail.gmail.com","subject":"Re: Bug: Git: Clone: University Network: No Output on Terminal","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-02-17T17:29:54Z","receivedAt":"2020-02-17T17:30:02Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-02-17 at 08:02:44, Manish Devgan wrote:\n> Hello,\n> \n> I am a university student from India and I was trying to clone the\n> xfwm4 git repository from the git-url :\n> https://git.xfce.org/xfce/xfwm4\n> I was trying to clone this repository over my university network and\n> it didn't work. I worked my way around by using my mobile\n> wireless-hotspot for the same and was able to do it just fine.\n> The next day I tried doing the exact same thing since I couldn't get\n> an answer from our university if any such firewall was blocking me\n> from cloning it. But this time instead of failing to reach the url the\n> command ran with the following output:\n> \n> gabru-md@bhaalu:~/Desktop$ git clone https://git.xfce.org/xfce/xfwm4\n> Cloning into 'xfwm4'...\n> \n> after waiting for a few minutes the command didn't fail but it didn't\n> show any output/stats like it does when I try to clone a repository\n> from Github which is definitely not blocked on the university network.\n> for eg.\n\nSo it looks like git.xfce.org is using the old dumb HTTP protocol, which\nbasically serves static content.  Git has to look up the references,\nattempt to download each object or pack, and then determine which ones\nhave the objects it needs.  The server provides no assistance in that\nregard.\n\n> gabru-md@bhaalu:~/Desktop$ git clone https://github.com/gabru-md/stl-cpp\n> Cloning into 'stl-cpp'...\n> remote: Enumerating objects: 186, done.\n> remote: Counting objects: 100% (186/186), done.\n> remote: Compressing objects: 100% (128/128), done.\n> remote: Total 186 (delta 92), reused 146 (delta 56), pack-reused 0\n> Receiving objects: 100% (186/186), 105.58 KiB | 256.00 KiB/s, done.\n> Resolving deltas: 100% (92/92), done.\n\nHere, GitHub uses the smart HTTP protocol.  The client fetches the\nreferences and then reports what data it has.  The server actively\ncomputes the differences and sends a single pack containing only the\nrequired objects.  In addition, newer versions of the smart HTTP\nprotocol contain a sideband where the server can report status, like the\n\"remote:\" message you see above.  The status messages on the client side\ncome from unpacking and indexing the single pack received.\n\nSo this is working by design, although it's confusing for users.  The\ndumb HTTP protocol doesn't know how much stuff it needs to fetch—it\ncould be a single object or pack, or it could be tens of thousands of\nitems—so it's hard to provide any progress report on the client side.\nAdditionally, because the server isn't actively producing a pack and is\njust serving static files, there's no way for it to provide status\noutput at all.\n\nHopefully this answers your question, although I agree the answer is a\nlittle unsatisfying.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"391950","messageId":"4d17a541-3c5c-0cf3-6ea6-11c214aa4674@web.de","threadId":"52820","inReplyTo":"CABVXwf6q1xMFhw+xd5f8GKATwC9k8mrXUkykpGgvTj7hv9pwEw@mail.gmail.com","subject":"Re: Bug: Git: Clone: University Network: No Output on Terminal","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-02-17T19:38:23Z","receivedAt":"2020-02-17T19:38:52Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 17.02.20 um 09:02 schrieb Manish Devgan:\n> Hello,\n>\n> I am a university student from India and I was trying to clone the\n> xfwm4 git repository from the git-url :\n> https://git.xfce.org/xfce/xfwm4\n> I was trying to clone this repository over my university network and\n> it didn't work. I worked my way around by using my mobile\n> wireless-hotspot for the same and was able to do it just fine.\n> The next day I tried doing the exact same thing since I couldn't get\n> an answer from our university if any such firewall was blocking me\n> from cloning it. But this time instead of failing to reach the url the\n> command ran with the following output:\n>\n> gabru-md@bhaalu:~/Desktop$ git clone https://git.xfce.org/xfce/xfwm4\n> Cloning into 'xfwm4'...\n>\n> after waiting for a few minutes the command didn't fail but it didn't\n> show any output/stats like it does when I try to clone a repository\n> from Github which is definitely not blocked on the university network.\n> for eg.\n\nThat doesn't sound ideal, but it also doesn't necessarily have to be a\nbug in the sense that git clone broke at some point.  It could be caused\nby the server side as well.\n\nWhat you see here is the default output of the so-called dumb HTTP\ntransport.  AFAUI it doesn't show any progress (yet?).  You can get some\nkind of progress messages by dialing up the verbosity way up with\nrepeated -v or --verbose options.  E.g.:\n\n   $ git clone -vvv https://git.xfce.org/xfce/xfwm4\n   Cloning into 'xfwm4'...\n   got 9a2556cfeedcc1b73cea36e5045073ecdf9fd39a\n   walk 9a2556cfeedcc1b73cea36e5045073ecdf9fd39a\n   Getting alternates list for https://git.xfce.org/xfce/xfwm4\n   Getting pack list for https://git.xfce.org/xfce/xfwm4\n   got 72b002b0f028fe610ba22035453647001e886969\n   Getting index for pack 3a53ad6629b13fd830436a47c59b86e29b565d88\n   got 600cb96c7eed28529fc8d5d0383d58070cb30957\n   Getting index for pack 9ef7bd53f4441a79be936132e1c4cde62f6fd9a8\n   Getting index for pack cef42fa75f4badc8e7ece5fee5ff8068dc8ae51b\n   [...]\n\n> gabru-md@bhaalu:~/Desktop$ git clone https://github.com/gabru-md/stl-cpp\n> Cloning into 'stl-cpp'...\n> remote: Enumerating objects: 186, done.\n> remote: Counting objects: 100% (186/186), done.\n> remote: Compressing objects: 100% (128/128), done.\n> remote: Total 186 (delta 92), reused 146 (delta 56), pack-reused 0\n> Receiving objects: 100% (186/186), 105.58 KiB | 256.00 KiB/s, done.\n> Resolving deltas: 100% (92/92), done.\n\nThis is the so-called smart HTTP transport at work, which does support\nprogress output.\n\nYou could use the git protocol to clone xfwm4:\n\n   $ git clone git://git.xfce.org/xfce/xfwm4\n   Cloning into 'xfwm4'...\n   remote: Counting objects: 66501, done.\n   remote: Compressing objects: 100% (16901/16901), done.\n   [...]\n\n> Furthermore the interesting thing is that I expected that my attempt\n> at cloning the xfwm4 repository might have failed but it surprisingly\n> did not. The command did clone the xfwm4 repository for me but it\n> didn't print out any stats/output during that time.\n>\n> After searching on DuckDuckGo I saw that adding flags `--verbose\n> --progress` will allow me to achieve the desired functionality. I\n> tried doing the same and the output is given below.\n>\n> gabru-md@bhaalu:~/Desktop/test$ git clone --progress --verbose\n> https://git.xfce.org/xfce/xfwm4\n> Cloning into 'xfwm4'...\n> gabru-md@bhaalu:~/Desktop/test$ ls\n> xfwm4\n> gabru-md@bhaalu:~/Desktop/test$ cd xfwm4/\n> gabru-md@bhaalu:~/Desktop/test/xfwm4$ cd icons/\n> gabru-md@bhaalu:~/Desktop/test/xfwm4/icons$ ls\n> 22x22  48x48  Makefile.am  scalable\n>\n> It is evident that the cloning worked perfectly fine but there didn't\n> seem to be any output on the terminal. At first I was convinced that\n> it was network error because it couldn't reach the target url but now\n> it doesn't seem to be a network problem.\n>\n> I am not quite sure if this unfamiliar behavior while cloning a\n> repository is a bug or not hence I thought of reporting it. Also,\n> Apologies if this is not a bug but something which is known already.\n>\n> I am currently running git version 2.17.1 on my Xubuntu.\n\nGit 2.25.1 shows the same behavior.\n\nI guess the reason the dumb HTTP transport doesn't show any progress is\nthat there is no way to know how much data it needs to download, so it\ncan't calculate a percentage of work done.  Perhaps showing a number\nthat is incremented with each GET request or a spinning wheel or so\ncould reassure users that git clone is still working?\n\nRené\n\n"},{"id":"391979","messageId":"CABVXwf404m9FdsoLxYxZriYT6uif_fsMs8B4dY4RmeQojqK9Wg@mail.gmail.com","threadId":"52820","inReplyTo":"4d17a541-3c5c-0cf3-6ea6-11c214aa4674@web.de","subject":"Re: Bug: Git: Clone: University Network: No Output on Terminal","fromName":"Manish Devgan","fromEmail":"manish.nsit8@gmail.com","sentAt":"2020-02-18T11:25:26Z","receivedAt":"2020-02-18T11:25:41Z","isPatch":false,"sender":{"key":"manish.nsit8@gmail.com","avatar":"https://gravatar.com/avatar/9248ecb21f4053d8d84f454840d7f0bfa8aa8aa9d73bd88d0f53a58cd2e7dc1b?d=mp&s=160"},"body":"On Tue, Feb 18, 2020 at 1:08 AM René Scharfe <l.s.r@web.de> wrote:\n>\n> Am 17.02.20 um 09:02 schrieb Manish Devgan:\n> > Hello,\n> >\n> > I am a university student from India and I was trying to clone the\n> > xfwm4 git repository from the git-url :\n> > https://git.xfce.org/xfce/xfwm4\n> > I was trying to clone this repository over my university network and\n> > it didn't work. I worked my way around by using my mobile\n> > wireless-hotspot for the same and was able to do it just fine.\n> > The next day I tried doing the exact same thing since I couldn't get\n> > an answer from our university if any such firewall was blocking me\n> > from cloning it. But this time instead of failing to reach the url the\n> > command ran with the following output:\n> >\n> > gabru-md@bhaalu:~/Desktop$ git clone https://git.xfce.org/xfce/xfwm4\n> > Cloning into 'xfwm4'...\n> >\n> > after waiting for a few minutes the command didn't fail but it didn't\n> > show any output/stats like it does when I try to clone a repository\n> > from Github which is definitely not blocked on the university network.\n> > for eg.\n>\n> That doesn't sound ideal, but it also doesn't necessarily have to be a\n> bug in the sense that git clone broke at some point.  It could be caused\n> by the server side as well.\n>\n> What you see here is the default output of the so-called dumb HTTP\n> transport.  AFAUI it doesn't show any progress (yet?).  You can get some\n> kind of progress messages by dialing up the verbosity way up with\n> repeated -v or --verbose options.  E.g.:\n\nThanks I will make sure to use the -vvv option next time.\n\n>\n>    $ git clone -vvv https://git.xfce.org/xfce/xfwm4\n>    Cloning into 'xfwm4'...\n>    got 9a2556cfeedcc1b73cea36e5045073ecdf9fd39a\n>    walk 9a2556cfeedcc1b73cea36e5045073ecdf9fd39a\n>    Getting alternates list for https://git.xfce.org/xfce/xfwm4\n>    Getting pack list for https://git.xfce.org/xfce/xfwm4\n>    got 72b002b0f028fe610ba22035453647001e886969\n>    Getting index for pack 3a53ad6629b13fd830436a47c59b86e29b565d88\n>    got 600cb96c7eed28529fc8d5d0383d58070cb30957\n>    Getting index for pack 9ef7bd53f4441a79be936132e1c4cde62f6fd9a8\n>    Getting index for pack cef42fa75f4badc8e7ece5fee5ff8068dc8ae51b\n>    [...]\n\nI tried it this way and it worked just like you've mentioned.\n\n>\n> > gabru-md@bhaalu:~/Desktop$ git clone https://github.com/gabru-md/stl-cpp\n> > Cloning into 'stl-cpp'...\n> > remote: Enumerating objects: 186, done.\n> > remote: Counting objects: 100% (186/186), done.\n> > remote: Compressing objects: 100% (128/128), done.\n> > remote: Total 186 (delta 92), reused 146 (delta 56), pack-reused 0\n> > Receiving objects: 100% (186/186), 105.58 KiB | 256.00 KiB/s, done.\n> > Resolving deltas: 100% (92/92), done.\n>\n> This is the so-called smart HTTP transport at work, which does support\n> progress output.\n>\n> You could use the git protocol to clone xfwm4:\n>\n>    $ git clone git://git.xfce.org/xfce/xfwm4\n>    Cloning into 'xfwm4'...\n>    remote: Counting objects: 66501, done.\n>    remote: Compressing objects: 100% (16901/16901), done.\n>    [...]\n\nThe problem is that my university has blocked git protocol and hence I\ncannot access it to clone the repository.\nMoreover cloning and pushing over ssh are also blocked which is really\nbad. The only way to get work done is to use HTTP. :(\n\n>\n> > Furthermore the interesting thing is that I expected that my attempt\n> > at cloning the xfwm4 repository might have failed but it surprisingly\n> > did not. The command did clone the xfwm4 repository for me but it\n> > didn't print out any stats/output during that time.\n> >\n> > After searching on DuckDuckGo I saw that adding flags `--verbose\n> > --progress` will allow me to achieve the desired functionality. I\n> > tried doing the same and the output is given below.\n> >\n> > gabru-md@bhaalu:~/Desktop/test$ git clone --progress --verbose\n> > https://git.xfce.org/xfce/xfwm4\n> > Cloning into 'xfwm4'...\n> > gabru-md@bhaalu:~/Desktop/test$ ls\n> > xfwm4\n> > gabru-md@bhaalu:~/Desktop/test$ cd xfwm4/\n> > gabru-md@bhaalu:~/Desktop/test/xfwm4$ cd icons/\n> > gabru-md@bhaalu:~/Desktop/test/xfwm4/icons$ ls\n> > 22x22  48x48  Makefile.am  scalable\n> >\n> > It is evident that the cloning worked perfectly fine but there didn't\n> > seem to be any output on the terminal. At first I was convinced that\n> > it was network error because it couldn't reach the target url but now\n> > it doesn't seem to be a network problem.\n> >\n> > I am not quite sure if this unfamiliar behavior while cloning a\n> > repository is a bug or not hence I thought of reporting it. Also,\n> > Apologies if this is not a bug but something which is known already.\n> >\n> > I am currently running git version 2.17.1 on my Xubuntu.\n>\n> Git 2.25.1 shows the same behavior.\n>\n> I guess the reason the dumb HTTP transport doesn't show any progress is\n> that there is no way to know how much data it needs to download, so it\n> can't calculate a percentage of work done.  Perhaps showing a number\n> that is incremented with each GET request or a spinning wheel or so\n> could reassure users that git clone is still working?\n>\n> René\n>\n\nYes. Having some sort of assurance that the clone command has not\nfailed would definitely be great.\nThe -vvv option puts out a great deal of stuff on my terminal which is\na sort of assurance that the command is working but it seems to print\nhuge loads of text which definitely does not make any sense to me at\nleast. I'd be more happy to see as you mentioned, a number or perhaps\na spinning wheel\nwhich denotes that the command is working.\n\nThanks & Regards\nManish Devgan\n"},{"id":"392001","messageId":"9ed26e7e-c19c-cdb2-0710-3b91bf31291b@web.de","threadId":"52820","inReplyTo":"CABVXwf404m9FdsoLxYxZriYT6uif_fsMs8B4dY4RmeQojqK9Wg@mail.gmail.com","subject":"Re: Bug: Git: Clone: University Network: No Output on Terminal","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-02-18T19:24:01Z","receivedAt":"2020-02-18T19:24:15Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 18.02.20 um 12:25 schrieb Manish Devgan:\n> The -vvv option puts out a great deal of stuff on my terminal which is\n> a sort of assurance that the command is working but it seems to print\n> huge loads of text which definitely does not make any sense to me at\n> least. I'd be more happy to see as you mentioned, a number or perhaps\n> a spinning wheel\n> which denotes that the command is working.\n\nHow about something like this?\n\n-- >8 --\nSubject: [PATCH] remote-curl: show progress for fetches over dumb HTTP\n\nFetching over dumb HTTP transport doesn't show any progress, even with\nthe option --progress.  If the connection is slow or there is a lot of\ndata to get then this can take a long time while the user is left to\nwonder if git got stuck.\n\nWe don't know the number of objects to fetch at the outset, but we can\ncount the ones we got.  Show an open-ended progress indicator based on\nthat number if the user asked for it.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\n remote-curl.c |  1 +\n walker.c      | 13 ++++++++++++-\n walker.h      |  1 +\n 3 files changed, 14 insertions(+), 1 deletion(-)\n\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 8eb96152f5..e4cd321844 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -1026,6 +1026,7 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch)\n\n \twalker = get_http_walker(url.buf);\n \twalker->get_verbosely = options.verbosity >= 3;\n+\twalker->get_progress = options.progress;\n \twalker->get_recover = 0;\n \tret = walker_fetch(walker, nr_heads, targets, NULL, NULL);\n \twalker_free(walker);\ndiff --git a/walker.c b/walker.c\nindex bb010f7a2b..4984bf8b3d 100644\n--- a/walker.c\n+++ b/walker.c\n@@ -8,6 +8,7 @@\n #include \"tag.h\"\n #include \"blob.h\"\n #include \"refs.h\"\n+#include \"progress.h\"\n\n static struct object_id current_commit_oid;\n\n@@ -162,6 +163,11 @@ static int process(struct walker *walker, struct object *obj)\n static int loop(struct walker *walker)\n {\n \tstruct object_list *elem;\n+\tstruct progress *progress = NULL;\n+\tuint64_t nr = 0;\n+\n+\tif (walker->get_progress)\n+\t\tprogress = start_delayed_progress(_(\"Fetching objects\"), 0);\n\n \twhile (process_queue) {\n \t\tstruct object *obj = process_queue->item;\n@@ -176,15 +182,20 @@ static int loop(struct walker *walker)\n \t\t */\n \t\tif (! (obj->flags & TO_SCAN)) {\n \t\t\tif (walker->fetch(walker, obj->oid.hash)) {\n+\t\t\t\tstop_progress(&progress);\n \t\t\t\treport_missing(obj);\n \t\t\t\treturn -1;\n \t\t\t}\n \t\t}\n \t\tif (!obj->type)\n \t\t\tparse_object(the_repository, &obj->oid);\n-\t\tif (process_object(walker, obj))\n+\t\tif (process_object(walker, obj)) {\n+\t\t\tstop_progress(&progress);\n \t\t\treturn -1;\n+\t\t}\n+\t\tdisplay_progress(progress, ++nr);\n \t}\n+\tstop_progress(&progress);\n \treturn 0;\n }\n\ndiff --git a/walker.h b/walker.h\nindex 6d8ae00e5b..d40b016bab 100644\n--- a/walker.h\n+++ b/walker.h\n@@ -10,6 +10,7 @@ struct walker {\n \tint (*fetch)(struct walker *, unsigned char *sha1);\n \tvoid (*cleanup)(struct walker *);\n \tint get_verbosely;\n+\tint get_progress;\n \tint get_recover;\n\n \tint corrupt_object_found;\n--\n2.25.1\n"},{"id":"392163","messageId":"CABVXwf6mPXWof3RHshDo=FSX8dvqUYDFH6-ecaCXDi4KhY8QJQ@mail.gmail.com","threadId":"52820","inReplyTo":"9ed26e7e-c19c-cdb2-0710-3b91bf31291b@web.de","subject":"Re: Bug: Git: Clone: University Network: No Output on Terminal","fromName":"Manish Devgan","fromEmail":"manish.nsit8@gmail.com","sentAt":"2020-02-20T10:20:07Z","receivedAt":"2020-02-20T10:20:23Z","isPatch":false,"sender":{"key":"manish.nsit8@gmail.com","avatar":"https://gravatar.com/avatar/9248ecb21f4053d8d84f454840d7f0bfa8aa8aa9d73bd88d0f53a58cd2e7dc1b?d=mp&s=160"},"body":"On Wed, Feb 19, 2020 at 12:54 AM René Scharfe <l.s.r@web.de> wrote:\n\n> How about something like this?\n>\n> -- >8 --\n> Subject: [PATCH] remote-curl: show progress for fetches over dumb HTTP\n>\n> Fetching over dumb HTTP transport doesn't show any progress, even with\n> the option --progress.  If the connection is slow or there is a lot of\n> data to get then this can take a long time while the user is left to\n> wonder if git got stuck.\n>\n> We don't know the number of objects to fetch at the outset, but we can\n> count the ones we got.  Show an open-ended progress indicator based on\n> that number if the user asked for it.\n>\n> Signed-off-by: René Scharfe <l.s.r@web.de>\n> ---\n>  remote-curl.c |  1 +\n>  walker.c      | 13 ++++++++++++-\n>  walker.h      |  1 +\n>  3 files changed, 14 insertions(+), 1 deletion(-)\n>\n> diff --git a/remote-curl.c b/remote-curl.c\n> index 8eb96152f5..e4cd321844 100644\n> --- a/remote-curl.c\n> +++ b/remote-curl.c\n> @@ -1026,6 +1026,7 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch)\n>\n>         walker = get_http_walker(url.buf);\n>         walker->get_verbosely = options.verbosity >= 3;\n> +       walker->get_progress = options.progress;\n>         walker->get_recover = 0;\n>         ret = walker_fetch(walker, nr_heads, targets, NULL, NULL);\n>         walker_free(walker);\n> diff --git a/walker.c b/walker.c\n> index bb010f7a2b..4984bf8b3d 100644\n> --- a/walker.c\n> +++ b/walker.c\n> @@ -8,6 +8,7 @@\n>  #include \"tag.h\"\n>  #include \"blob.h\"\n>  #include \"refs.h\"\n> +#include \"progress.h\"\n>\n>  static struct object_id current_commit_oid;\n>\n> @@ -162,6 +163,11 @@ static int process(struct walker *walker, struct object *obj)\n>  static int loop(struct walker *walker)\n>  {\n>         struct object_list *elem;\n> +       struct progress *progress = NULL;\n> +       uint64_t nr = 0;\n> +\n> +       if (walker->get_progress)\n> +               progress = start_delayed_progress(_(\"Fetching objects\"), 0);\n>\n>         while (process_queue) {\n>                 struct object *obj = process_queue->item;\n> @@ -176,15 +182,20 @@ static int loop(struct walker *walker)\n>                  */\n>                 if (! (obj->flags & TO_SCAN)) {\n>                         if (walker->fetch(walker, obj->oid.hash)) {\n> +                               stop_progress(&progress);\n>                                 report_missing(obj);\n>                                 return -1;\n>                         }\n>                 }\n>                 if (!obj->type)\n>                         parse_object(the_repository, &obj->oid);\n> -               if (process_object(walker, obj))\n> +               if (process_object(walker, obj)) {\n> +                       stop_progress(&progress);\n>                         return -1;\n> +               }\n> +               display_progress(progress, ++nr);\n>         }\n> +       stop_progress(&progress);\n>         return 0;\n>  }\n>\n> diff --git a/walker.h b/walker.h\n> index 6d8ae00e5b..d40b016bab 100644\n> --- a/walker.h\n> +++ b/walker.h\n> @@ -10,6 +10,7 @@ struct walker {\n>         int (*fetch)(struct walker *, unsigned char *sha1);\n>         void (*cleanup)(struct walker *);\n>         int get_verbosely;\n> +       int get_progress;\n>         int get_recover;\n>\n>         int corrupt_object_found;\n> --\n> 2.25.1\n\nThis is great. But perhaps I would want the output to come\nirrespective of --progress argument in case of dumb_http.\n\nThanks & Regards\nManish Devgan\n"},{"id":"392175","messageId":"520ed4fd-40cf-04ff-4717-f7d5c962a748@web.de","threadId":"52820","inReplyTo":"CABVXwf6mPXWof3RHshDo=FSX8dvqUYDFH6-ecaCXDi4KhY8QJQ@mail.gmail.com","subject":"Re: Bug: Git: Clone: University Network: No Output on Terminal","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-02-20T16:07:00Z","receivedAt":"2020-02-20T16:07:16Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 20.02.20 um 11:20 schrieb Manish Devgan:\n> This is great. But perhaps I would want the output to come\n> irrespective of --progress argument in case of dumb_http.\n\nIt's on by default if you use git on a terminal (as opposed to calling\nit from a script).\n\nRené\n"}]}