Re: [PATCH v5] quickfetch(): Prevent overflow of the rev-list command line
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 11, 2009, 06:55 UTC
- Message-ID
- <7vy6qvn1ya.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <200907100152.30683.johan@herland.net>
Johan Herland <johan@herland.net> writes:
Show 11 quoted lines
> 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. 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.