This is an archive of the discontinued LLVM Phabricator instance.

[Docs] Mention clone depth feature of git in LLVM getting started
ClosedPublic

Authored by xgupta on Feb 20 2021, 6:08 AM.

Details

Summary

The current size of the llvm-project repository exceeds 1 GB. A shallow clone can save a lot of space and time. Some developers might not aware of this feature.

Diff Detail

Event Timeline

xgupta requested review of this revision.Feb 20 2021, 6:08 AM
xgupta created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 20 2021, 6:08 AM

Thank you for sending this - I frequently use shallow clones!

I have a small suggestion. How about this:

* To save storage and speed-up the checkout time, you may want to do a `shallow clone <https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt>`_. For example, to get the latest revision of the LLVM project, use ``git clone --depth 1 https://github.com/llvm/llvm-project.git``
xgupta updated this revision to Diff 325418.Feb 22 2021, 4:47 AM

Thanks @awarzynski for reviewing! your wording is more correct.

I quickly compared shallow vs deep clones (this by no means thorough):

  • deep clone: ~6mins, ~2.5GB
  • shallow clone: ~1.5mins, ~1.2GB

So clearly this is a very useful recommendation.

LGTM, thanks for working on this! @jyknight was the last person to touch this bit of documentation - he might have some comments/pointers. Could you wait a day or two before merging?

awarzynski accepted this revision.Feb 22 2021, 6:04 AM
This revision is now accepted and ready to land.Feb 22 2021, 6:04 AM
xgupta added a comment.EditedFeb 22 2021, 6:26 AM

I quickly compared shallow vs deep clones (this by no means thorough):

  • deep clone: ~6mins, ~2.5GB
  • shallow clone: ~1.5mins, ~1.2GB

Don't know how you did it, but on system shallow clone with 'git clone --depth 1 https://github.com/<username>/llvm-project.git command download 142.44 MiB. (and internet speed is ofcourse less ):

LGTM, thanks for working on this! @jyknight was the last person to touch this bit of documentation - he might have some comments/pointers. Could you wait a day or two before merging?

Sure!

Don't know how you did it, but on system shallow clone with 'git clone --depth 1 https://github.com/<username>/llvm-project.git command download 142.44 MiB. (and internet speed is ofcourse less ):

Sorry, I was referring to the space the repo consumes after unpacking. You are right, only ~140MBs are downloaded. I should've been clearer!

Sorry, I was referring to the space the repo consumes after unpacking. You are right, only ~140MBs are downloaded. I should've been clearer!

No worries :-) My mind just thinks more about internet data uses than hard drive storage.