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

Re: [PATCH v5] quickfetch(): Prevent overflow of the rev-list command line

From
Johan Herland <johan@herland.net>
Date
Jul 11, 2009, 10:58 UTC
Message-ID
<200907111258.25118.johan@herland.net>
In-Reply-To
<7vy6qvn1ya.fsf@alter.siamese.dyndns.org>
On Saturday 11 July 2009, Junio C Hamano wrote:
Show 17 quoted lines
> Johan Herland <johan@herland.net> writes:
> > quickfetch() calls rev-list to check whether the objects we are about
> > to fetch are already present in the repo (if so, we can skip the object
> > fetch). However, when there are many (~1000) refs to be fetched, the
> > rev-list command line grows larger than the maximum command line size
> > on some systems (32K in Windows). This causes rev-list to fail, making
> > quickfetch() return non-zero, which unnecessarily triggers the
> > transport machinery. This somehow causes fetch to fail with an exit
> > code.
> >
> > By using the --stdin option to rev-list (and feeding the object list to
> > its standard input), we prevent the overflow of the rev-list command
> > line, which causes quickfetch(), and subsequently the overall fetch, to
> > succeed.
>
> I feel uneasy with that "somehow" at the end of the first paragraph, but
> nevertheless this is the right thing to do.

Yes, it feels wrong that transport_fetch_refs() returns error when there are no objects to be fetched. After all, the quickfetch() routine is only meant to be an optimization (to skip the object fetching when not needed). Only if quickfetch() returned a false positive (indicating that all objects are present when they're really not) would I expect it to have adverse effects on the result of the fetch. But even then, as you indicate, fixing quickfetch() itself is the right thing to do, and looking into transport_fetch_refs() is a separate issue.

> Since it is a very isolated
> change, I'd queue this directly on 'master' and see if anybody notices a
> breakage, as it would be relatively pain-free to revert if it turns out
> to be necessary.
Thanks.
Have fun! :)
...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Junio C HamanoNext: Johan Herland
Message 21 of 28 in “msysgit git-submodule: "Unable to fetch in submodule path ..."”
  1. Peter KreftingJun 18, 2009
  2. Peter KreftingJun 22, 2009
  3. quickfetch(): Prevent overflow of the rev-list command lineJohan Herland, Jul 8, 2009
  4. Johannes SixtJul 8, 2009
  5. Johan HerlandJul 8, 2009
  6. Junio C HamanoJul 8, 2009
  7. Johan HerlandJul 9, 2009
  8. Alex RiesenJul 9, 2009
  9. Johannes SixtJul 9, 2009
  10. Johan HerlandJul 9, 2009
  11. Johannes SixtJul 9, 2009
  12. quickfetch(): Prevent overflow of the rev-list command lineJohan Herland, Jul 9, 2009
  13. Johannes SixtJul 9, 2009
  14. quickfetch(): Prevent overflow of the rev-list command lineJohan Herland, Jul 9, 2009
  15. Johannes SixtJul 9, 2009
  16. Jeff KingJul 9, 2009
  17. quickfetch(): Prevent overflow of the rev-list command lineJohan Herland, Jul 9, 2009
  18. Johannes SixtJul 9, 2009
  19. quickfetch(): Prevent overflow of the rev-list command lineJohan Herland, Jul 9, 2009
  20. Junio C HamanoJul 11, 2009
  21. Johan HerlandJul 11, 2009
  22. Johan HerlandJul 9, 2009
  23. Johannes SixtJul 9, 2009
  24. Johan HerlandJul 9, 2009
  25. Johannes SixtJul 9, 2009
  26. Alex RiesenJul 9, 2009
  27. Johan HerlandJul 9, 2009
  28. Alex RiesenJul 9, 2009

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.