Re: [PATCH] clone: check if server supports shallow clones

2015-06-17 Thread Jeff King
On Wed, Jun 17, 2015 at 09:35:23AM -0700, Junio C Hamano wrote: Of course it's hard to add to the test suite, since we do not have a way of hitting a server that does not understand shallow (I simply fudged server_supports() to return false on the client). We've had the shallow

Re: [PATCH] clone: check if server supports shallow clones

2015-06-17 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Thu, Jun 11, 2015 at 08:02:33PM +0700, Duy Nguyen wrote: I see that do_fetch_pack checks server_supports(shallow). Is that enough to cover all fetch cases? And if it is, why does it not cover the matching clone cases? I think this replacement check

Re: [PATCH] clone: check if server supports shallow clones

2015-06-11 Thread Jeff King
On Thu, Jun 11, 2015 at 08:02:33PM +0700, Duy Nguyen wrote: I see that do_fetch_pack checks server_supports(shallow). Is that enough to cover all fetch cases? And if it is, why does it not cover the matching clone cases? I think this replacement check would do if ((args-depth 0 ||

Re: [PATCH] clone: check if server supports shallow clones

2015-06-11 Thread Duy Nguyen
On Thu, Jun 11, 2015 at 2:05 AM, Jeff King p...@peff.net wrote: On Wed, Jun 10, 2015 at 02:35:20PM -0400, Mike Edgar wrote: When the user passes --depth to git-clone the server's capabilities are not currently consulted. The client will send shallow requests even if the server does not

Re: [PATCH] clone: check if server supports shallow clones

2015-06-11 Thread Junio C Hamano
Michael Edgar ad...@google.com writes: On Thu, Jun 11, 2015 at 10:32 AM, Jeff King p...@peff.net wrote: On Thu, Jun 11, 2015 at 08:02:33PM +0700, Duy Nguyen wrote: I see that do_fetch_pack checks server_supports(shallow). Is that enough to cover all fetch cases? And if it is, why does it

Re: [PATCH] clone: check if server supports shallow clones

2015-06-11 Thread Michael Edgar
On Thu, Jun 11, 2015 at 10:32 AM, Jeff King p...@peff.net wrote: On Thu, Jun 11, 2015 at 08:02:33PM +0700, Duy Nguyen wrote: I see that do_fetch_pack checks server_supports(shallow). Is that enough to cover all fetch cases? And if it is, why does it not cover the matching clone cases? I

Re: [PATCH] clone: check if server supports shallow clones

2015-06-10 Thread Michael Edgar
On Wed, Jun 10, 2015 at 3:05 PM, Jeff King p...@peff.net wrote: I see that do_fetch_pack checks server_supports(shallow). Is that enough to cover all fetch cases? And if it is, why does it not cover the matching clone cases? -Peff Great question. I determined that the do_fetch_pack logic

[PATCH] clone: check if server supports shallow clones

2015-06-10 Thread Mike Edgar
When the user passes --depth to git-clone the server's capabilities are not currently consulted. The client will send shallow requests even if the server does not understand them, and the resulting error may be unhelpful to the user. This change pre-emptively checks so git-clone can exit with a

Re: [PATCH] clone: check if server supports shallow clones

2015-06-10 Thread Jeff King
On Wed, Jun 10, 2015 at 02:35:20PM -0400, Mike Edgar wrote: When the user passes --depth to git-clone the server's capabilities are not currently consulted. The client will send shallow requests even if the server does not understand them, and the resulting error may be unhelpful to the user.

Re: [PATCH] clone: check if server supports shallow clones

2015-06-10 Thread Jeff King
On Wed, Jun 10, 2015 at 04:25:45PM -0400, Michael Edgar wrote: On Wed, Jun 10, 2015 at 3:05 PM, Jeff King p...@peff.net wrote: I see that do_fetch_pack checks server_supports(shallow). Is that enough to cover all fetch cases? And if it is, why does it not cover the matching clone cases?