Well, sorta obvious since CI jobs don't take forev...
# random
e
Well, sorta obvious since CI jobs don't take forever - but I did not know you could get a shallow git clone at any sha from scratch:
Copy code
$ time bash -c 'git clone <https://github.com/pantsbuild/pants> pants-full-clone && cd pants-full-clone && git reset --hard release_2.14.1 && git rev-parse HEAD'
Cloning into 'pants-full-clone'...
remote: Enumerating objects: 255113, done.
remote: Counting objects: 100% (416/416), done.
remote: Compressing objects: 100% (301/301), done.
remote: Total 255113 (delta 129), reused 315 (delta 90), pack-reused 254697
Receiving objects: 100% (255113/255113), 143.75 MiB | 1.22 MiB/s, done.
Resolving deltas: 100% (170400/170400), done.
HEAD is now at 33a6cf8a5 Version bump to 2.14.1.
33a6cf8a53daf5b39fbaca9798bb6f2459314dec

real    2m0.310s
user    0m7.522s
sys     0m3.604s
Vs:
Copy code
$ time bash -c 'git init pants-shallow-not-head && cd pants-shallow-not-head && git fetch --depth 1 <https://github.com/pantsbuild/pants> 33a6cf8a53daf5b39fbaca9798bb6f2459314dec && git
reset --hard 33a6cf8a53daf5b39fbaca9798bb6f2459314dec'
Initialized empty Git repository in /tmp/pants-shallow-not-head/.git/
remote: Enumerating objects: 2129, done.
remote: Counting objects: 100% (2129/2129), done.
remote: Compressing objects: 100% (1863/1863), done.
remote: Total 2129 (delta 410), reused 694 (delta 209), pack-reused 0
Receiving objects: 100% (2129/2129), 3.45 MiB | 3.03 MiB/s, done.
Resolving deltas: 100% (410/410), done.
From <https://github.com/pantsbuild/pants>
 * branch            33a6cf8a53daf5b39fbaca9798bb6f2459314dec -> FETCH_HEAD
HEAD is now at 33a6cf8 Version bump to 2.14.1.

real    0m3.038s
user    0m0.207s
sys     0m0.107s
The only 2 requirements are: 1. The git server has the right options turned on (GitHub does) 2. You know the full sha you want - abreviations, etc won't work.
🎉 2