# git clone takes ages on a slow link

3 messages from 2006-06-04 to 2006-06-04. Participants: Anton Blanchard, Linus Torvalds.
Thread: https://gitlist.dev/t/4385

## Anton Blanchard, 2006-06-04 01:01

Subject: git clone takes ages on a slow link
Message-ID: <20060604010145.GC986@krispykreme>
URL: https://gitlist.dev/e/20060604010145.GC986%40krispykreme

```

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, 2006-06-04 17:48

Subject: Re: git clone takes ages on a slow link
Message-ID: <Pine.LNX.4.64.0606041046340.5498@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0606041046340.5498%40g5.osdl.org
In-Reply-To: <20060604010145.GC986@krispykreme>

```


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, 2006-06-04 22:29

Subject: Re: git clone takes ages on a slow link
Message-ID: <20060604222901.GD986@krispykreme>
URL: https://gitlist.dev/e/20060604222901.GD986%40krispykreme
In-Reply-To: <Pine.LNX.4.64.0606041046340.5498@g5.osdl.org>

```

Hi Linus,

> 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

> 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;
>  				}
>  			}
>  		}

```
