jambonz / jambonz-infrastructure

packer and cloudformation templates for creating EC2-based jambonz deployments
23 stars 29 forks source link

git clone does not need history #28

Open asarubbo opened 1 year ago

asarubbo commented 1 year ago

Hello Dave,

I noticed that there are a lot of git clone into install_freeswitch.sh but may apply to other scripts as well.

So, when you need to switch at specific commit with git checkout $HASH you need the whole history, but when you need the project at the latest commit you can use the option --depth 1 that avoids to fetch the entire history; here is an example:

ago@spectre /tmp/fs $ time git clone https://github.com/signalwire/freeswitch.git test1
Cloning into 'test1'...
remote: Enumerating objects: 318443, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 318443 (delta 0), reused 0 (delta 0), pack-reused 318440
Receiving objects: 100% (318443/318443), 129.80 MiB | 10.63 MiB/s, done.
Resolving deltas: 100% (248878/248878), done.

real    0m22,127s
user    0m30,149s
sys     0m2,748s

ago@spectre /tmp/fs $ time git clone --depth 1 https://github.com/signalwire/freeswitch.git test2
Cloning into 'test2'...
remote: Enumerating objects: 6978, done.
remote: Counting objects: 100% (6978/6978), done.
remote: Compressing objects: 100% (5477/5477), done.
remote: Total 6978 (delta 1628), reused 4199 (delta 1100), pack-reused 0
Receiving objects: 100% (6978/6978), 28.77 MiB | 6.36 MiB/s, done.
Resolving deltas: 100% (1628/1628), done.

real    0m7,583s
user    0m2,725s
sys     0m0,699s

I saved 15 seconds because of my great connection, but I guess I make people with bad connection more happy than ever.

Thanks