passing "--depth=1" to repo init -- good/bad/ugly?

66 views
Skip to first unread message

John W. Blue

unread,
Nov 6, 2019, 4:39:58 PM11/6/19
to android-...@googlegroups.com

Downloading the source for any branch has historically been a heavy lift simply due to the sheer size of the code.

 

For example, for the Pixel XL I sync’d 10.0.0_r5 and it clocked in at 48.2 GB.  The .repo folder alone is showing that is has 42.9 GB of the total.

 

I have been reading that passing “-- depth=1” to repo init results in a “shallow clone” that should significantly reduce the size.  JBQ indicated as much with some testing in this thread:

 

https://groups.google.com/forum/#!topic/repo-discuss/WejHXT2LdlY

 

JBQ also goes on to mention:

 

1.       You're using a non-resumable protocol, so you need a reliable enough connection.

2.       You won't have any change history.

3.       You won't be able to push from such a client (including the ability to upload changes).

4.       Future syncs might re-download everything again.

 

For what I do, building basically a stock AOSP ROM, I don’t think that 2 and 3 will cause any heartburn.  1 and 4 *might* be in play but I wanted to validate with the group if it is even a thing at this point in time especially #4.

 

Outside of what is listed are there any unintended consequences of using shallow clones that would cause a ROM to be horked up?

 

 

Dan Willemsen

unread,
Nov 6, 2019, 4:49:45 PM11/6/19
to Android Building
It can still be the quickest way to download the least data to get an initial tree. But you do lose all the history, uploads tend not to work well, nor do cherry-picks, and the next download is quite possibly bigger (even if it doesn't fail and you've got to remove and re-download that project from scratch).


Git and repo are starting to support a "partial clone" feature that should be an improvement over --depth, in that you still get all the history, you just don't need to download all the files until you actually need them. There are cases where it's still slower, though depending on your download speed, it may not be too bad:

repo init --partial-clone -u https://android.googlesource.com/platform/manifest -b ...

You probably want to make sure that your git client is up to date, I know there's been active work to make this better (but I'm not following it too closely).

- Dan

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/25dceaa908fa4e7e953ad793cba77de9%40mail.rrcic.com.
Reply all
Reply to author
Forward
0 new messages