Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-11 Thread Jeff King
On Fri, Mar 11, 2016 at 07:47:34AM +0700, Duy Nguyen wrote: > Well, assume again that F and G are ref heads, and their respective > distance to C and D are the same (like the below graph), then "fetch > --deptch=" can mark C and D as shallow cut points because > --depth traverses from refs until

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-11 Thread Junio C Hamano
Duy Nguyen writes: > Well, assume again that F and G are ref heads, and their respective > distance to C and D are the same (like the below graph), then "fetch > --deptch=" can mark C and D as shallow cut points because > --depth traverses from refs until the distance is met,

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-10 Thread Duy Nguyen
On Fri, Mar 11, 2016 at 4:40 AM, Jeff King wrote: > On Thu, Mar 10, 2016 at 01:26:08PM -0800, Junio C Hamano wrote: > >> > IMHO, that is the right thing. They asked for "C" as a shallow cut-off >> > point, so anything that is a parent of "C" should be omitted as shallow, >> > too.

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-10 Thread Jeff King
On Thu, Mar 10, 2016 at 01:26:08PM -0800, Junio C Hamano wrote: > > IMHO, that is the right thing. They asked for "C" as a shallow cut-off > > point, so anything that is a parent of "C" should be omitted as shallow, > > too. It has nothing to do with the numeric depth, which was just the > >

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-10 Thread Jeff King
On Thu, Mar 10, 2016 at 07:20:20PM +0700, Duy Nguyen wrote: > > + else if (shallows.nr > 0) { > > + struct rev_info revs; > > + struct argv_array av = ARGV_ARRAY_INIT; > > + struct commit *c; > > + int i; > > + > > + argv_array_push(,

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-10 Thread Duy Nguyen
On Tue, Mar 08, 2016 at 08:25:24AM -0500, Jeff King wrote: > I think this patch does roughly the right thing: > > diff --git a/upload-pack.c b/upload-pack.c > index 4859535..da76f70 100644 > --- a/upload-pack.c > +++ b/upload-pack.c > @@ -833,12 +833,41 @@ static void receive_needs(void) >

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-08 Thread Duy Nguyen
On Tue, Mar 8, 2016 at 8:30 PM, Jeff King wrote: > On Tue, Mar 08, 2016 at 08:25:24AM -0500, Jeff King wrote: > >> > Good news. We have the mechanism in place, I think. >> > get_shallow_commits_by_rev_list() (from 'pu') will produce the right >> > shallow points for sending back to

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-08 Thread Jeff King
On Tue, Mar 08, 2016 at 08:25:24AM -0500, Jeff King wrote: > > Good news. We have the mechanism in place, I think. > > get_shallow_commits_by_rev_list() (from 'pu') will produce the right > > shallow points for sending back to the client if you pass "--not > > " to it. It's meant to be used for >

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-08 Thread Jeff King
On Tue, Mar 08, 2016 at 07:33:43PM +0700, Duy Nguyen wrote: > On Tue, Mar 8, 2016 at 7:14 PM, Jeff King wrote: > > ... > > > > So I think the solution to both is that we need to do a _separate_ > > traversal with all of the positive tips we're going to send, and the > > parents of

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-08 Thread Duy Nguyen
On Tue, Mar 8, 2016 at 7:14 PM, Jeff King wrote: > ... > > So I think the solution to both is that we need to do a _separate_ > traversal with all of the positive tips we're going to send, and the > parents of any shallow commits the client has, to find their fork points > (i.e.,

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-08 Thread Jeff King
On Tue, Mar 08, 2016 at 07:53:35AM +0700, Duy Nguyen wrote: > > I also do not offhand think of a good way to use the topology or > > timestamp to figure out the best "depth" to truncate the side branch > > at. The server side may be able to figure out that things before 'F' > > in your picture

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-08 Thread Jeff King
On Mon, Mar 07, 2016 at 03:47:53PM -0800, Junio C Hamano wrote: > > Is this user error to call "git fetch" without "--depth" in the > > subsequent cases? Or should git remember that we are in a shallow repo, > > and presume that the user by default wants to keep things shallow? > > Hmph, you

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-07 Thread Duy Nguyen
On Tue, Mar 8, 2016 at 6:47 AM, Junio C Hamano wrote: > Jeff King writes: > >> I don't know how the client invoked git, but we can guess what happened >> and simulate with: >> >> git tag shallow ecd7ea6033fe8a05d5c21f3a54355fded6942659 >> git tag old

Re: [BUG?] fetch into shallow sends a large number of objects

2016-03-07 Thread Junio C Hamano
Jeff King writes: > I don't know how the client invoked git, but we can guess what happened > and simulate with: > > git tag shallow ecd7ea6033fe8a05d5c21f3a54355fded6942659 > git tag old 067f265bb512c95b22b83ccd121b9facbddcf6b1 > git tag new

[BUG?] fetch into shallow sends a large number of objects

2016-03-07 Thread Jeff King
I came across an interesting shallow-fetch case, and I suspect git is doing something very sub-optimal. You can reproduce with: git clone --bare git://github.com/CocoaPods/Specs cd Specs.git time git pack-objects --revs --thin --stdout \ --delta-base-offset