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

Re: [PATCH v2 3/3] {fetch,upload}-pack: allow --depth=0 for infinite depth

From
Jeff King <peff@peff.net>
Date
Aug 24, 2010, 17:46 UTC
Message-ID
<20100824174622.GA31283@sigill.intra.peff.net>
In-Reply-To
<7vvd6zx63h.fsf@alter.siamese.dyndns.org>
On Tue, Aug 24, 2010 at 10:39:46AM -0700, Junio C Hamano wrote:
Show 14 quoted lines
> 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
Previous: Junio C HamanoNext: Nguyen Thai Ngoc Duy
Message 8 of 11 in “clone: warn users --depth is ignored in local clones”
  1. 1/3 clone: warn users --depth is ignored in local clonesNguyễn Thái Ngọc Duy, Aug 23, 2010
  2. 2/3 fetch-pack: use args.shallow to detect shallow clone instead of args.depthNguyễn Thái Ngọc Duy, Aug 23, 2010
  3. Junio C HamanoAug 24, 2010
  4. Nguyen Thai Ngoc DuyAug 24, 2010
  5. 3/3 {fetch,upload}-pack: allow --depth=0 for infinite depthNguyễn Thái Ngọc Duy, Aug 23, 2010
  6. Jeff KingAug 24, 2010
  7. Junio C HamanoAug 24, 2010
  8. Jeff KingAug 24, 2010
  9. Nguyen Thai Ngoc DuyAug 24, 2010
  10. Jonathan NiederAug 24, 2010
  11. Nguyen Thai Ngoc DuyAug 24, 2010

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.