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 p...@peff.net 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: [...] --- expect

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

2013-04-08 Thread Thomas Rast
John Koleszar jkoles...@google.com 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 jkoles...@google.com At the risk of repeating something that's

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-08

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 p...@peff.net 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, buf);

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 gits...@pobox.com wrote: Jeff King p...@peff.net 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

[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 jkoles...@google.com --- Incorporate peff's suggested test, and Junio's comments. With regard to whether it's

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

2013-04-04 Thread Junio C Hamano
John Koleszar jkoles...@google.com 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); +

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 gits...@pobox.com wrote: John Koleszar jkoles...@google.com writes: @@ -402,7 +404,8 @@ static void get_info_refs(char *arg) } else { select_getanyfile(); - for_each_ref(show_text_ref, buf); +

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 gits...@pobox.com wrote: John Koleszar jkoles...@google.com writes: @@ -402,7 +404,8 @@ static void get_info_refs(char *arg) } else { select_getanyfile();

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 correct

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

2013-04-04 Thread Junio C Hamano
Jeff King p...@peff.net 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

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 the right place to

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 | grep /$NS/

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 your

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

2013-04-03 Thread Junio C Hamano
John Koleszar jkoles...@google.com 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

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

2013-04-03 Thread Junio C Hamano
Jeff King p...@peff.net 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:

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 jkoles...@google.com 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

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

2013-03-28 Thread Junio C Hamano
John Koleszar jkoles...@google.com 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

[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 jkoles...@google.com --- http-backend.c | 8 +--- t/lib-httpd/apache.conf | 5 +