From: Johan Herland <johan@herland.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Sixt <j.sixt@viscovery.net>, Jeff King <peff@peff.net>,
Git Mailing List <git@vger.kernel.org>,
Peter Krefting <peter@softwolves.pp.se>,
"Shawn O. Pearce" <spearce@spearce.org>,
Alex Riesen <raa.lkml@gmail.com>
Subject: Re: [PATCH v5] quickfetch(): Prevent overflow of the rev-list command line
Date: Sat, 11 Jul 2009 12:58:24 +0200 [thread overview]
Message-ID: <200907111258.25118.johan@herland.net> (raw)
In-Reply-To: <7vy6qvn1ya.fsf@alter.siamese.dyndns.org>
On Saturday 11 July 2009, Junio C Hamano wrote:
> 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
next prev parent reply other threads:[~2009-07-11 10:59 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-18 13:10 msysgit git-submodule: "Unable to fetch in submodule path ..." Peter Krefting
2009-06-22 12:46 ` Peter Krefting
2009-07-08 13:58 ` [PATCH] quickfetch(): Prevent overflow of the rev-list command line Johan Herland
2009-07-08 15:12 ` Johannes Sixt
2009-07-08 16:01 ` Johan Herland
2009-07-08 17:22 ` Junio C Hamano
2009-07-09 8:43 ` Johan Herland
2009-07-09 8:49 ` Alex Riesen
2009-07-09 8:51 ` Johannes Sixt
2009-07-09 9:07 ` Johan Herland
2009-07-09 9:15 ` Johannes Sixt
2009-07-09 9:34 ` Johan Herland
2009-07-09 12:22 ` Johannes Sixt
2009-07-09 13:52 ` [PATCH v3] " Johan Herland
2009-07-09 14:21 ` Johannes Sixt
2009-07-09 14:32 ` Jeff King
2009-07-09 14:49 ` [PATCH v4] " Johan Herland
2009-07-09 16:20 ` Johannes Sixt
2009-07-09 23:52 ` [PATCH v5] " Johan Herland
2009-07-11 6:55 ` Junio C Hamano
2009-07-11 10:58 ` Johan Herland [this message]
2009-07-09 14:42 ` [PATCH v3] " Johan Herland
2009-07-09 14:56 ` Johannes Sixt
2009-07-09 15:32 ` Johan Herland
2009-07-09 16:14 ` Johannes Sixt
2009-07-09 8:01 ` [PATCH] " Alex Riesen
2009-07-09 8:37 ` Johan Herland
2009-07-09 8:43 ` Alex Riesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200907111258.25118.johan@herland.net \
--to=johan@herland.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
--cc=peff@peff.net \
--cc=peter@softwolves.pp.se \
--cc=raa.lkml@gmail.com \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).