git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 3/4] gitfaq: shallow cloning a repository

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 22, 2020, 04:00 UTC
Message-ID
<20200422040058.GB200999@google.com>
In-Reply-To
<9142ccdb-6359-4936-e621-55eab980b7cd@gmail.com>
Derrick Stolee wrote:
Show 8 quoted lines
> Of course, with the speedups from reachability bitmaps, it is sometimes
> _faster_ to do a partial clone than a shallow clone. (It definitely takes
> less time in the "counting objects" phase, and the cost of downloading
> all commits and trees might be small enough on top of the necessary blob
> data to keep the total cost under a shallow clone. Your mileage may vary.)
> Because the cost of a partial clone is "comparable" to shallow clone, I
> would almost recommend partial clone over shallow clones 95% of the time,
> even in scenarios like automated builds on cloud-hosted VMs.
By the way, an idea for the interested (#leftoverbits?):

It would be possible to emulate the shallow clone experience making use of the partial clone protocol. That is, fetch a full history without blobs but record the "shallows" somewhere and make user-facing traversals like "git log" stop there (similar to the effect "git replace" has on user-facing traversals). Then later fetches would be able to take advantage of the full commit history, but scripts and muscle memory (e.g., the assumption that most commands will never contact the remote) that assume a shallow clone would continue to work.

Would that be useful or interesting to people?

Thanks, Jonathan

Previous: Derrick StoleeNext: Elijah Newren
Message 13 of 15 in “gitfaq: add issues in the 'Common Issues' section”
  1. 0/4 gitfaq: add issues in the 'Common Issues' sectionShourya Shukla, Apr 21, 2020
  2. 1/4 gitfaq: files in .gitignore are trackedShourya Shukla, Apr 21, 2020
  3. Junio C HamanoApr 21, 2020
  4. 2/4 gitfaq: changing the remote of a repositoryShourya Shukla, Apr 21, 2020
  5. Junio C HamanoApr 21, 2020
  6. Shourya ShuklaApr 27, 2020
  7. 3/4 gitfaq: shallow cloning a repositoryShourya Shukla, Apr 21, 2020
  8. Junio C HamanoApr 21, 2020
  9. Randall S. BeckerApr 21, 2020
  10. Junio C HamanoApr 21, 2020
  11. Randall S. BeckerApr 21, 2020
  12. Derrick StoleeApr 22, 2020
  13. Jonathan NiederApr 22, 2020
  14. Elijah NewrenApr 22, 2020
  15. 4/4 gitfaq: fetching and pulling a repositoryShourya Shukla, Apr 21, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.