Re: [PATCH v2 3/3] {fetch,upload}-pack: allow --depth=0 for infinite depth
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Aug 24, 2010, 22:12 UTC
- Message-ID
- <AANLkTimqwXmRYVZLkYtGLd5=e1B0hKKePA0XzOYPrifd@mail.gmail.com>
- In-Reply-To
- <20100824135341.GA6457@coredump.intra.peff.net>
On Tue, Aug 24, 2010 at 11:53 PM, Jeff King <peff@peff.net> wrote:
Show 9 quoted lines
> On Mon, Aug 23, 2010 at 10:08:24PM +1000, Nguyễn Thái Ngọc Duy wrote: > >> Users can do --depth=2147483648 for infinite depth now. It just looks >> ugly. So make "0" special (i.e. infinite depth) at plumbing/protocol >> level. > > What happens if I connect to an older server? Shouldn't "I understand > depth=0 is infinite" be a server capability, and we hack around it by > sending depth=2^32-1 when we have a modern client but an older server?
Older servers won't accept depth=0, dying with "Invalid deepen" message. I don't really want to send a large number as a workaround, it just does not feel safe. Users can either play around with --depth=2^32-1, or upgrade servers.
And in case of modern server and old client, old fetch-pack would never send "deepen 0", so it's safe too, at least for current fetch-pack.
-- Duy