threads / discuss / 4385

git clone takes ages on a slow link

Subject: git clone takes ages on a slow link

## tl;dr

3 messages between Jun 4, 2006 and Jun 4, 2006.

replies: 2people: 2as markdown or json

Anton Blanchard· Jun 4, 2006, 01:01 UTC · lore
Hi,

I tried cloning a local repository when connected over a slow (1 second+ latency) link. It took forever (I gave up after 10 minutes). If I ran it in the background it took a few seconds.

I think the ticker is over anxious.
# git clone -l linux-2.6 linux-2.6-test
0 blocks
Checking files out...
   5% (1060/19552) done			<---- performance bottleneck
Anton
Linus Torvalds· Jun 4, 2006, 17:48 UTC · re: Anton Blanchard · lore

Re: git clone takes ages on a slow link

On Sun, 4 Jun 2006, Anton Blanchard wrote:
> 
> I think the ticker is over anxious.

It is indeed. It's _meant_ to only tick once a second or when the percentage changes, but I think it forgot to clear the "once a second happened" flag, so instead of updates the percentage output for every file it checks out after the first second has passed.

So something like this should help... Can you verify?
		Linus
---
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 716f792..80c9320 100644
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
@@ -336,6 +336,7 @@ static void check_updates(struct cache_e
 					fprintf(stderr, "%4u%% (%u/%u) done\r",
 						percent, cnt, total);
 					last_percent = percent;
+					progress_update = 0;
 				}
 			}
 		}
Anton Blanchard· Jun 4, 2006, 22:29 UTC · re: Linus Torvalds · lore

Re: git clone takes ages on a slow link

Hi Linus,
Show 6 quoted lines
> It is indeed. It's _meant_ to only tick once a second or when the 
> percentage changes, but I think it forgot to clear the "once a second 
> happened" flag, so instead of updates the percentage output for every 
> file it checks out after the first second has passed.
> 
> So something like this should help... Can you verify?
Thanks, it fixes it.
Anton
Show 12 quoted lines
> diff --git a/builtin-read-tree.c b/builtin-read-tree.c
> index 716f792..80c9320 100644
> --- a/builtin-read-tree.c
> +++ b/builtin-read-tree.c
> @@ -336,6 +336,7 @@ static void check_updates(struct cache_e
>  					fprintf(stderr, "%4u%% (%u/%u) done\r",
>  						percent, cnt, total);
>  					last_percent = percent;
> +					progress_update = 0;
>  				}
>  			}
>  		}

← back to recent threads