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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:22

Jeff King [off-list ref] writes:
On Mon, Aug 23, 2010 at 10:08:24PM +1000, Nguyễn Thái Ngọc Duy wrote:
quoted
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?

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

From: Jeff King <hidden>
Date: 2016-06-15 22:49:22

On Tue, Aug 24, 2010 at 10:39:46AM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
On Mon, Aug 23, 2010 at 10:08:24PM +1000, Nguyễn Thái Ngọc Duy wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help