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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 4, 2013, 17:25 UTC
Message-ID
<7v6202jjhx.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1365091293-23758-1-git-send-email-jkoleszar@google.com>
John Koleszar <jkoleszar@google.com> writes:
Show 9 quoted lines
> @@ -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_ref, &buf);
>  		send_strbuf("text/plain", &buf);
>  	}

Whether we are namespaced or not, we used to do for_each_ref() here, not advertising the HEAD (outside refs/ hierarchy), but we now do, and as the first element in the output.

Am I reading the patch correctly?

Is that an unrelated but useful bugfix even for people who do not use server namespaces?

Show 15 quoted lines
> diff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh
> index ef98d95..85a5625 100755
> --- a/t/t5560-http-backend-noserver.sh
> +++ b/t/t5560-http-backend-noserver.sh
> @@ -26,6 +26,13 @@ GET() {
>  	test_cmp exp act
>  }
>  
> +GET_BODY() {
> +	REQUEST_METHOD="GET" && export REQUEST_METHOD &&
> +	run_backend "/repo.git/$1" &&
> +	sane_unset REQUEST_METHOD &&
> +	tr '\015' Q <act.out | sed '1,/^Q$/d'
> +}
> +

These "export/unset" in &&-chains will allow a failing test to affect the next test, but that is not a new problem (existing POST already has that problem). Just highlighting, so that interested people may notice and want to clean it up on top of this patch.

>  POST() {
>  	REQUEST_METHOD="POST" && export REQUEST_METHOD &&
>  	CONTENT_TYPE="application/x-$1-request" && export CONTENT_TYPE &&
Thanks, will queue.
Previous: John KoleszarNext: John Koleszar
Message 13 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.