git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jeff King <peff@peff.net>
Date
Apr 3, 2013, 16:10 UTC
Message-ID
<20130403161038.GB16885@sigill.intra.peff.net>
In-Reply-To
<1365004329-15264-1-git-send-email-jkoleszar@google.com>
On Wed, Apr 03, 2013 at 08:52:09AM -0700, John Koleszar wrote:
Show 15 quoted lines
> +	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/ >/dev/null &&
> +
> +	SMART=smart_namespace &&
> +	GIT_NAMESPACE=$NS && export GIT_NAMESPACE &&
> +	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/ >/dev/null)
> +)'

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:

diff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh
index 47eb769..9fd8bbf 100755
--- a/t/t5551-http-fetch.sh
+++ b/t/t5551-http-fetch.sh
@@ -162,6 +162,18 @@ test_expect_success 'invalid Content-Type rejected' '
 	grep "not valid:" actual
 '
 
+test_expect_success 'create namespaced refs' '
+	test_commit namespaced &&
+	git push public HEAD:refs/namespaces/ns/refs/heads/master
+'
+
+test_expect_success 'clone respects namespace' '
+	git clone --bare "$HTTPD_URL/smart_namespace/repo.git" ns.git &&
+	echo namespaced >expect &&
+	git --git-dir=ns.git log -1 --format=%s >actual &&
+	test_cmp expect actual
+'
+
 test -n "$GIT_TEST_LONG" && test_set_prereq EXPENSIVE
 
 test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '

-Peff
Previous: John KoleszarNext: Jeff King
Message 8 of 26 in “http-backend: respect GIT_NAMESPACE with dumb clients”
  1. http-backend: respect GIT_NAMESPACE with dumb clientsJohn Koleszar, Mar 28, 2013
  2. Junio C HamanoMar 28, 2013
  3. Josh TriplettMar 28, 2013
  4. Junio C HamanoMar 28, 2013
  5. John KoleszarMar 28, 2013
  6. Junio C HamanoMar 28, 2013
  7. http-backend: respect GIT_NAMESPACE with dumb clientsJohn Koleszar, Apr 3, 2013
  8. Jeff KingApr 3, 2013
  9. Jeff KingApr 3, 2013
  10. Junio C HamanoApr 3, 2013
  11. John KoleszarApr 4, 2013
  12. http-backend: respect GIT_NAMESPACE with dumb clientsJohn Koleszar, Apr 4, 2013
  13. Junio C HamanoApr 4, 2013
  14. John KoleszarApr 5, 2013
  15. Josh TriplettApr 5, 2013
  16. Jeff KingApr 5, 2013
  17. Junio C HamanoApr 5, 2013
  18. Jeff KingApr 5, 2013
  19. John KoleszarApr 6, 2013
  20. http-backend: respect GIT_NAMESPACE with dumb clientsJohn Koleszar, Apr 10, 2013
  21. Junio C HamanoApr 10, 2013
  22. Jeff KingApr 10, 2013
  23. Thomas RastApr 8, 2013
  24. Jeff KingApr 8, 2013
  25. John KoleszarApr 9, 2013
  26. Junio C HamanoApr 3, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.