Re: [PATCH on master v2] revision: use commit graph in get_reference()

2018-12-13 Thread Derrick Stolee
On 12/12/2018 8:27 PM, Jeff King wrote: On Wed, Dec 12, 2018 at 11:58:12AM -0800, Jonathan Tan wrote: Yeah, this was the part that took me a bit to figure out, as well. The optimization here is really just avoiding a call to lookup_commit(), which will do a single hash-table lookup. I wonder if

Re: [PATCH on master v2] revision: use commit graph in get_reference()

2018-12-12 Thread Jeff King
On Wed, Dec 12, 2018 at 11:58:12AM -0800, Jonathan Tan wrote: > > Yeah, this was the part that took me a bit to figure out, as well. The > > optimization here is really just avoiding a call to lookup_commit(), > > which will do a single hash-table lookup. I wonder if that's actually > > worth this

Re: [PATCH on master v2] revision: use commit graph in get_reference()

2018-12-12 Thread Jonathan Tan
> On Sun, Dec 09, 2018 at 09:51:28AM +0900, Junio C Hamano wrote: > > > > -static int parse_commit_in_graph_one(struct commit_graph *g, struct > > > commit *item) > > > +static struct commit *parse_commit_in_graph_one(struct repository *r, > > > + struct co

Re: [PATCH on master v2] revision: use commit graph in get_reference()

2018-12-11 Thread Jeff King
On Sun, Dec 09, 2018 at 09:51:28AM +0900, Junio C Hamano wrote: > > -static int parse_commit_in_graph_one(struct commit_graph *g, struct commit > > *item) > > +static struct commit *parse_commit_in_graph_one(struct repository *r, > > + struct commit_graph

Re: [PATCH on master v2] revision: use commit graph in get_reference()

2018-12-08 Thread Junio C Hamano
Junio C Hamano writes: > Jonathan Tan writes: > >> When fetching into a repository, a connectivity check is first made by >> check_exist_and_connected() in builtin/fetch.c that runs: >> ... >> Another way to accomplish this effect would be to modify parse_object() >> to use the commit graph if p

Re: [PATCH on master v2] revision: use commit graph in get_reference()

2018-12-08 Thread Junio C Hamano
Jonathan Tan writes: > When fetching into a repository, a connectivity check is first made by > check_exist_and_connected() in builtin/fetch.c that runs: > ... > Another way to accomplish this effect would be to modify parse_object() > to use the commit graph if possible; however, I did not want

[PATCH on master v2] revision: use commit graph in get_reference()

2018-12-07 Thread Jonathan Tan
When fetching into a repository, a connectivity check is first made by check_exist_and_connected() in builtin/fetch.c that runs: git rev-list --objects --stdin --not --all --quiet <(list of objects) If the client repository has many refs, this command can be slow, regardless of the nature of th