Reduce git fetch depth. 100 still takes quite some time!

```
(git init servo.git &&
    cd servo.git &&
    time git fetch https://github.com/servo/servo master $ARGS &&
); rm -rf servo.git

Full: 724.75 MiB
      57s home fiber in Paris
    1m25s AWS us-west-2 Oregon
    3m23s Macstadium DC1 Atlanta
    4m22s Macstadium DC2 Las Vegas

--depth 100: 129.00 MiB
    1m21s home
    1m18s AWS
    1m30s Macstadium 1
    1m24s Macstadium 2

--depth 50: 97.62 MiB
    30s home
    30s AWS
    41s Macstadium 1
    40s Macstadium 2

--depth 30: 92.47 MiB
    17s home
    18s AWS
    27s Macstadium 1
    26s Macstadium 2

--depth 10: 88.25 MiB
    11s home
    12s AWS
    26s Macstadium 1
    25s Macstadium 2

--depth 1: 87.53 MiB
    10s home
    10s AWS
    22s Macstadium 1
    28s Macstadium 2
```
This commit is contained in:
Simon Sapin 2019-11-16 14:15:52 +01:00
parent a74046a3b6
commit 188dd9e7ab

View file

@ -477,7 +477,7 @@ class WindowsGenericWorkerTask(GenericWorkerTask):
git += """
git fetch {depth} %GIT_URL% %GIT_REF%
git reset --hard %GIT_SHA%
""".format(depth="--depth 100" if shallow else "")
""".format(depth="--depth 30" if shallow else "")
return self \
.with_git() \
.with_script(git) \
@ -599,7 +599,7 @@ class UnixTaskMixin(Task):
cd repo
time git fetch {depth} "$GIT_URL" "$GIT_REF"
time git reset --hard "$GIT_SHA"
""".format(depth="--depth 100" if shallow else ""))
""".format(depth="--depth 30" if shallow else ""))
def with_curl_script(self, url, file_path):
self.curl_scripts_count += 1