PSA: fetch now supports --no-history to reduce checkout time/size

1,470 views
Skip to first unread message

Primiano Tucci

unread,
Aug 8, 2014, 4:24:30 PM8/8/14
to Chromium-dev
I've just landed a change in depot_tools which adds a new --no-history option to fetch (and gclient). This allows to get a working checkout (w/o history) in ~26 min from a 8 Mbit/s DSL [1]. 

In the very essence this works like a git clone --depth, but is DEPS-aware and works consistently with our pinned subprojects (shallowing the minimum amount of commits to track the right revisions).

Why:
This is to deal with the difficulties that many people have reported in this ML [2].
Our repository/history is huge (~9 Gigs of .git objects), git doesn't support resuming interrupted downloads -> fetching chrome from a slow / flaky network connection can be a huge pain.

When should you use it:
In general, this option is discouraged for regular chromium developers [3].
However, if you are trying to fetch chromium from a very slow connection and not interested in the history, this can save several gigs (approx. -7GB) from your checkout and reduce sensibly the fetch times (~26 mins instead of ~hours). 

How does this affect your workflow:
This change should not interfere in any way with your current workflow (as long as you don't pass --no-history).
If you see anything weird, either locally or on the bots, related with history/shallow please let me know.

Curious about some stats the size of our .git repo? Check this thread

P.S. Many thanks to our infra folks for the prompt response / suggestions in the CR.

Cheers,
Primiano


[1] I was able to complete a fetch in 26 mins over a 8M DSL instead of ~hours. Other infra folks experienced similar speedups. See comments in crrev.com/437903002.

[2]
  [chromium-dev] "fetch chromium" keeps hanging/getting stuck on Windows 7
  [chromium-dev] Initial checkout with git taking long
  [chromium-dev] Trying to get latest source code fails when fetching
  [chromium-dev] Gclient sync takes too long

[3] I did a manual smoke test and at gclient sync / git cl upload seem to work fine with a shallow clone (tried on Mac and Ubuntu). I won't be surprised, though, if some of our other tools make assumptions on having a non-shallow checkout (certainly the bisect scripts do :) ).

mich...@chromium.org

unread,
Aug 8, 2014, 6:44:57 PM8/8/14
to chromi...@chromium.org
Thank you for this! I had to fetch chromium on my personal PC over the weekend and this would have been really nice to have.

Paweł Hajdan, Jr.

unread,
Aug 11, 2014, 5:02:21 AM8/11/14
to Michael Giuffrida, chromium-dev
Please consider mentioning this flag on http://www.chromium.org/developers/how-tos/get-the-code

Paweł


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Primiano Tucci

unread,
Aug 11, 2014, 6:11:04 AM8/11/14
to phajd...@chromium.org, Michael Giuffrida, Chromium-dev

I think I did that in the page you mentioned on the same day of the PSA. 
see the section " If you have a slow connection... "

On 11 Aug 2014 12:08, "Primiano Tucci" <prim...@google.com> wrote:

I think I did that in the page you mentioned on the same day of the PSA.
see the section " If you have a slow connection... "

Reply all
Reply to author
Forward
0 new messages