Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-09 Thread John Koleszar
On Mon, Apr 8, 2013 at 2:45 PM, Jeff King wrote: > On Mon, Apr 08, 2013 at 11:25:39PM +0200, Thomas Rast wrote: > >> At the risk of repeating something that's been said already -- I only >> skimmed the thread -- this test breaks in today's pu on my machine. I >> get: >> [...] >> --- expect201

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-08 Thread Jeff King
On Mon, Apr 08, 2013 at 11:25:39PM +0200, Thomas Rast wrote: > At the risk of repeating something that's been said already -- I only > skimmed the thread -- this test breaks in today's pu on my machine. I > get: > [...] > --- expect2013-04-08 21:24:36.571874540 + > +++ actual2013-04-0

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-08 Thread Thomas Rast
John Koleszar writes: > Filter the list of refs returned via the dumb HTTP protocol according > to the active namespace, consistent with other clients of the > upload-pack service. > > Signed-off-by: John Koleszar At the risk of repeating something that's been said already -- I only skimmed the

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-05 Thread John Koleszar
On Thu, Apr 4, 2013 at 10:43 PM, Jeff King wrote: > > On Thu, Apr 04, 2013 at 10:34:49PM -0700, Junio C Hamano wrote: > > > > +static void get_head(char *arg) > > > +{ > > > + struct strbuf buf = STRBUF_INIT; > > > + head_ref_namespaced(show_text_ref, &buf); > > > + send_strbuf("text/plain",

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-04 Thread Jeff King
On Thu, Apr 04, 2013 at 10:34:49PM -0700, Junio C Hamano wrote: > > +static void get_head(char *arg) > > +{ > > + struct strbuf buf = STRBUF_INIT; > > + head_ref_namespaced(show_text_ref, &buf); > > + send_strbuf("text/plain", &buf); > > + strbuf_release(&buf); > > +} > > You identified t

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-04 Thread Junio C Hamano
Jeff King writes: > Yeah, that makes sense. I think we'd want something like the (totally > untested) patch below. And the tests I provided for t5551 should be > amended to set up a HEAD within the namespace, should make the resulting > clone non-bare, and should confirm that we check out the cor

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-04 Thread Jeff King
On Thu, Apr 04, 2013 at 07:35:16PM -0700, Josh Triplett wrote: > > Including the HEAD ref in the advertisement from /info/refs ends up > > duplicating it, since the dumb client unconditionally fetches the file > > /HEAD to use as the that ref. I think the right thing to do is > > generate the corr

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-04 Thread Josh Triplett
On Thu, Apr 04, 2013 at 06:22:08PM -0700, John Koleszar wrote: > On Thu, Apr 4, 2013 at 10:25 AM, Junio C Hamano wrote: > > John Koleszar writes: > > > >> @@ -402,7 +404,8 @@ static void get_info_refs(char *arg) > >> > >> } else { > >> select_getanyfile(); > >> - f

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-04 Thread John Koleszar
On Thu, Apr 4, 2013 at 10:25 AM, Junio C Hamano wrote: > John Koleszar writes: > >> @@ -402,7 +404,8 @@ static void get_info_refs(char *arg) >> >> } else { >> select_getanyfile(); >> - for_each_ref(show_text_ref, &buf); >> + head_ref_namespaced(show_tex

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-04 Thread Junio C Hamano
John Koleszar writes: > @@ -402,7 +404,8 @@ static void get_info_refs(char *arg) > > } else { > select_getanyfile(); > - for_each_ref(show_text_ref, &buf); > + head_ref_namespaced(show_text_ref, &buf); > + for_each_namespaced_ref(show_text

[PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-04 Thread John Koleszar
Filter the list of refs returned via the dumb HTTP protocol according to the active namespace, consistent with other clients of the upload-pack service. Signed-off-by: John Koleszar --- Incorporate peff's suggested test, and Junio's comments. With regard to whether it's sufficient to test for th

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-04 Thread John Koleszar
On Wed, Apr 3, 2013 at 11:05 AM, Junio C Hamano wrote: > Jeff King writes: > >> On Wed, Apr 03, 2013 at 12:10:38PM -0400, Jeff King wrote: >> >>> Hmm. This is testing just the ref advertisement. It would be nice to see >>> a complete transaction tested with namespaces turned on. Something like >>

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-03 Thread Junio C Hamano
Jeff King writes: > On Wed, Apr 03, 2013 at 12:10:38PM -0400, Jeff King wrote: > >> Hmm. This is testing just the ref advertisement. It would be nice to see >> a complete transaction tested with namespaces turned on. Something like >> this (squashed into your patch) seems to work for me: > > Actu

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-03 Thread Junio C Hamano
John Koleszar writes: > diff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh > index b5d7fbc..97f97a1 100755 > --- a/t/t5561-http-backend.sh > +++ b/t/t5561-http-backend.sh > @@ -23,6 +23,10 @@ GET() { > test_cmp exp act > } > > +GET_BODY() { > + curl "$HTTPD_URL/$SMART/rep

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-03 Thread Jeff King
On Wed, Apr 03, 2013 at 12:10:38PM -0400, Jeff King wrote: > Hmm. This is testing just the ref advertisement. It would be nice to see > a complete transaction tested with namespaces turned on. Something like > this (squashed into your patch) seems to work for me: Actually, I guess the point of yo

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-03 Thread Jeff King
On Wed, Apr 03, 2013 at 08:52:09AM -0700, John Koleszar wrote: > + SMART=smart > + git ls-remote public >expected && > + grep /$NS/ expected >/dev/null && > + GET_BODY "info/refs" >actual && > + test_cmp expected actual && > + GET_BODY "info/refs?service=git-upload-pack"

[PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-04-03 Thread John Koleszar
Filter the list of refs returned via the dumb HTTP protocol according to the active namespace, consistent with other clients of the upload-pack service. Signed-off-by: John Koleszar --- This should incorporate all of Junio's and Josh's comments. Also fixes a bug in the first patch where the HEAD

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-03-28 Thread Junio C Hamano
John Koleszar writes: >> Facepalm. The intent here is to invert the grep, to make sure that the /ns/ >> does not appear in the output. No idea why I wrote it that way. Will fix. OK, "! grep /ns/ exp" would do. Thanks. -- To unsubscribe from this list: send the line "unsubscribe git" in the bod

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-03-28 Thread Josh Triplett
On Wed, Mar 27, 2013 at 11:02:28PM -0700, Junio C Hamano wrote: > John Koleszar writes: > > > Filter the list of refs returned via the dumb HTTP protocol according > > to the active namespace, consistent with other clients of the > > upload-pack service. > > > > Signed-off-by: John Koleszar > >

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-03-28 Thread John Koleszar
On Thu, Mar 28, 2013 at 8:52 AM, John Koleszar wrote: > On Thu, Mar 28, 2013 at 7:43 AM, Junio C Hamano wrote: >> >> John Koleszar writes: >> >> > diff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh >> > index b5d7fbc..5a19d61 100755 >> > --- a/t/t5561-http-backend.sh >> > +++ b/t/t55

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-03-28 Thread Junio C Hamano
John Koleszar writes: > diff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh > index b5d7fbc..5a19d61 100755 > --- a/t/t5561-http-backend.sh > +++ b/t/t5561-http-backend.sh > @@ -134,6 +134,10 @@ POST /smart/repo.git/git-receive-pack HTTP/1.1 200 - > ### > GET /smart/repo.git/info/re

Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-03-27 Thread Junio C Hamano
John Koleszar writes: > Filter the list of refs returned via the dumb HTTP protocol according > to the active namespace, consistent with other clients of the > upload-pack service. > > Signed-off-by: John Koleszar > --- Looks sane from a cursory read---thanks. Josh, any comments? > http-back

[PATCH] http-backend: respect GIT_NAMESPACE with dumb clients

2013-03-27 Thread John Koleszar
Filter the list of refs returned via the dumb HTTP protocol according to the active namespace, consistent with other clients of the upload-pack service. Signed-off-by: John Koleszar --- http-backend.c | 8 +--- t/lib-httpd/apache.conf | 5 + t/t5561-http-backend.sh | 4