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

Re: Git 2.26 fetches many times more objects than it should, wasting gigabytes

From
Jeff King <peff@peff.net>
Date
Apr 22, 2020, 19:36 UTC
Message-ID
<20200422193658.GC558336@coredump.intra.peff.net>
In-Reply-To
<20200422154025.GA91734@google.com>
On Wed, Apr 22, 2020 at 08:40:25AM -0700, Jonathan Nieder wrote:
> I think this still suggests that we should go ahead and switch
> negotiation algorithms, both because it avoids this MAX_IN_VAIN and
> because it reduces the number of rounds needed to make progress.

I'd be happier about that if the other algorithm turned up the same pack that v0 does. But it has twice as many objects.

It looks to me like v0 is just more aggressive about digging in the history. That _does_ cost more rounds, but this example shows that there's a benefit to doing so for real-world cases.

> I'd also be tempted to get rid of MAX_IN_VAIN.  If we're at the point
> of giving up, shouldn't we error out instead of having the server send
> a copy of the entirety of history?

How would you fetch in cases where the client and server legitimately don't have any common commits?

You could add a flag to force it, but I don't know that you're really making users any happier. Fetching the whole history is annoying, but refusing to fetch at all is perhaps more so. From the user's perspective either the full fetch is what they want, or Git is broken.

-Peff
Previous: Jonathan NiederNext: Jonathan Nieder
Message 11 of 18 in “Git 2.26 fetches many times more objects than it should, wasting gigabytes”
  1. Lubomir RintelApr 22, 2020
  2. Jeff KingApr 22, 2020
  3. Jeff KingApr 22, 2020
  4. Jeff KingApr 22, 2020
  5. Junio C HamanoApr 22, 2020
  6. Jeff KingApr 22, 2020
  7. Jonathan TanApr 23, 2020
  8. Junio C HamanoApr 23, 2020
  9. Jeff KingApr 24, 2020
  10. Jonathan NiederApr 22, 2020
  11. Jeff KingApr 22, 2020
  12. Revert "fetch: default to protocol version 2"Jonathan Nieder, Apr 22, 2020
  13. Junio C HamanoApr 22, 2020
  14. Jeff KingApr 22, 2020
  15. Jeff KingApr 22, 2020
  16. Jonathan NiederApr 22, 2020
  17. Junio C HamanoApr 22, 2020
  18. Jeff KingApr 22, 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.