Re: [PATCH 1/3] serve: pass "config context" through to individual commands

2018-12-18 Thread Jeff King
On Sun, Dec 16, 2018 at 08:12:03PM +0900, Junio C Hamano wrote: > Jeff King writes: > > > Yeah, I agree that such a "pass this through" struct full of options and > > context would make sense. I just wouldn't tie it to the "serve" > > machinery. > > > > Did you read the side-thread between me an

Re: [PATCH 1/3] serve: pass "config context" through to individual commands

2018-12-16 Thread Junio C Hamano
Jeff King writes: > Yeah, I agree that such a "pass this through" struct full of options and > context would make sense. I just wouldn't tie it to the "serve" > machinery. > > Did you read the side-thread between me and Jonathan? Another option > here is to just have ls-refs assume that the clien

Re: [PATCH 1/3] serve: pass "config context" through to individual commands

2018-12-16 Thread Jeff King
On Sat, Dec 15, 2018 at 09:31:15AM +0900, Junio C Hamano wrote: > Jeff King writes: > > > I actually started by doing that, but "struct serve_options" is not > > currently known by ls-refs.c, upload-pack.c, etc. So they'd have to > > start including "serve.h". I don't think that's the end of the

Re: [PATCH 1/3] serve: pass "config context" through to individual commands

2018-12-14 Thread Junio C Hamano
Jeff King writes: > I actually started by doing that, but "struct serve_options" is not > currently known by ls-refs.c, upload-pack.c, etc. So they'd have to > start including "serve.h". I don't think that's the end of the world, > but it felt like a funny mutual circular to me (my mental model n

Re: [PATCH 1/3] serve: pass "config context" through to individual commands

2018-12-14 Thread Jeff King
On Fri, Dec 14, 2018 at 01:28:20AM -0800, Jonathan Nieder wrote: > > Certainly if that information was carried from the client request it > > would work fine, and ls-refs would have enough to know which config to > > respect. But I could not find any documentation on this, nor discussion > > of pl

Re: [PATCH 1/3] serve: pass "config context" through to individual commands

2018-12-14 Thread Jonathan Nieder
Jeff King wrote: > On Fri, Dec 14, 2018 at 12:36:21AM -0800, Jonathan Nieder wrote: >> Jeff King wrote: >>> In protocol v2, instead of just running "upload-pack", we have a generic >>> "serve" loop which runs command requests from the client. What used to >>> be "upload-pack" is now generally spli

Re: [PATCH 1/3] serve: pass "config context" through to individual commands

2018-12-14 Thread Jeff King
On Fri, Dec 14, 2018 at 12:36:21AM -0800, Jonathan Nieder wrote: > Jeff King wrote: > > > In protocol v2, instead of just running "upload-pack", we have a generic > > "serve" loop which runs command requests from the client. What used to > > be "upload-pack" is now generally split into two operat

Re: [PATCH 1/3] serve: pass "config context" through to individual commands

2018-12-14 Thread Jonathan Nieder
Hi, Jeff King wrote: > In protocol v2, instead of just running "upload-pack", we have a generic > "serve" loop which runs command requests from the client. What used to > be "upload-pack" is now generally split into two operations: "ls-refs" > and "fetch". The latter knows it must respect uploadp

Re: [PATCH 1/3] serve: pass "config context" through to individual commands

2018-12-14 Thread Jeff King
On Fri, Dec 14, 2018 at 11:09:53AM +0900, Junio C Hamano wrote: > > diff --git a/ls-refs.h b/ls-refs.h > > index b62877e8da..da26fc9824 100644 > > --- a/ls-refs.h > > +++ b/ls-refs.h > > @@ -4,7 +4,8 @@ > > struct repository; > > struct argv_array; > > struct packet_reader; > > -extern int ls_r

Re: [PATCH 1/3] serve: pass "config context" through to individual commands

2018-12-13 Thread Junio C Hamano
Jeff King writes: > In protocol v2, instead of just running "upload-pack", we have a generic > "serve" loop which runs command requests from the client. What used to > be "upload-pack" is now generally split into two operations: "ls-refs" > and "fetch". The latter knows it must respect uploadpack

[PATCH 1/3] serve: pass "config context" through to individual commands

2018-12-11 Thread Jeff King
In protocol v2, instead of just running "upload-pack", we have a generic "serve" loop which runs command requests from the client. What used to be "upload-pack" is now generally split into two operations: "ls-refs" and "fetch". The latter knows it must respect uploadpack.* config, but the former is