git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH v2 3/3] {fetch,upload}-pack: allow --depth=0 for infinite depth
Date: Tue, 24 Aug 2010 13:46:22 -0400	[thread overview]
Message-ID: <20100824174622.GA31283@sigill.intra.peff.net> (raw)
In-Reply-To: <7vvd6zx63h.fsf@alter.siamese.dyndns.org>

On Tue, Aug 24, 2010 at 10:39:46AM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > 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?
> 
> Good point.  Do we also need to find out how wide an int is on the other
> end in that case?

I doubt it. We can probably assume that the remote can handle a signed
32-bit depth (so really, my example should have been 2^31-1). If they
can't, then it would probably be at best an unsigned 16-bit int, in
which case we could only handle a depth of 65535 commits. There are way
more than that in common repositories, so --depth with such an
implementation would be pretty broken already.

-Peff

  reply	other threads:[~2010-08-24 17:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23 12:08 [PATCH v2 1/3] clone: warn users --depth is ignored in local clones Nguyễn Thái Ngọc Duy
2010-08-23 12:08 ` [PATCH v2 2/3] fetch-pack: use args.shallow to detect shallow clone instead of args.depth Nguyễn Thái Ngọc Duy
2010-08-24 16:31   ` Junio C Hamano
2010-08-24 22:14     ` Nguyen Thai Ngoc Duy
2010-08-23 12:08 ` [PATCH v2 3/3] {fetch,upload}-pack: allow --depth=0 for infinite depth Nguyễn Thái Ngọc Duy
2010-08-24 13:53   ` Jeff King
2010-08-24 17:39     ` Junio C Hamano
2010-08-24 17:46       ` Jeff King [this message]
2010-08-24 22:12     ` Nguyen Thai Ngoc Duy
2010-08-24  5:28 ` [PATCH v2 1/3] clone: warn users --depth is ignored in local clones Jonathan Nieder
2010-08-24  5:52   ` Nguyen Thai Ngoc Duy

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100824174622.GA31283@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).