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

Re: [PATCH] Docs: web server must setenv GIT_PROTOCOL for v2

From
Jeff King <peff@peff.net>
Date
Sep 10, 2021, 11:39 UTC
Message-ID
<YTtECuP2/A6+EI4J@coredump.intra.peff.net>
In-Reply-To
<xmqqa6kl1wjs.fsf@gitster.g>
On Thu, Sep 09, 2021 at 10:35:51AM -0700, Junio C Hamano wrote:
Show 17 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> >> @@ -789,6 +790,9 @@ int cmd_main(int argc, const char **argv)
> >>  	http_config();
> >>  	max_request_buffer = git_env_ulong("GIT_HTTP_MAX_REQUEST_BUFFER",
> >>  					   max_request_buffer);
> >> +	proto_header = getenv("HTTP_GIT_PROTOCOL");
> >> +	if (proto_header)
> >> +		setenv(GIT_PROTOCOL_ENVIRONMENT, proto_header, 1);
> 
> Since this overwrites (I noticed the "1" at the end), the server
> operator cannot force a particular protocol with their server
> configuration, no?
> 
> Would a weaker form to use 0 (set if there isn't any, but keep the
> value if somebody else already has set it) work OK?  Would that have
> a downside?

Yeah, I wondered about that while writing it, but struggled to think of a reason why the server operator would want to set it at all.

But maybe as a workaround for some misbehaving client (e.g., recognizing it by a user-agent header). Or we could even perhaps use this in our tests to test the v2-client-to-v0-server fallback behavior.

I'll re-roll with that change, plus some documentation changes adapted to this new approach.

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 10 of 20 in “Docs: web server must setenv GIT_PROTOCOL for v2”
  1. Docs: web server must setenv GIT_PROTOCOL for v2Konstantin Ryabitsev, Sep 4, 2021
  2. Jeff KingSep 4, 2021
  3. Junio C HamanoSep 7, 2021
  4. Konstantin RyabitsevSep 7, 2021
  5. Jeff KingSep 8, 2021
  6. Jeff KingSep 8, 2021
  7. Eric WongSep 8, 2021
  8. Junio C HamanoSep 9, 2021
  9. Junio C HamanoSep 9, 2021
  10. Jeff KingSep 10, 2021
  11. Jeff KingSep 10, 2021
  12. 1/5 t5551: test v2-to-v0 http protocol fallbackJeff King, Sep 10, 2021
  13. 2/5 http-backend: handle HTTP_GIT_PROTOCOL CGI variableJeff King, Sep 10, 2021
  14. 3/5 docs/http-backend: mention v2 protocolJeff King, Sep 10, 2021
  15. 4/5 docs/git: discuss server-side config for GIT_PROTOCOLJeff King, Sep 10, 2021
  16. 5/5 docs/protocol-v2: point readers transport config discussionJeff King, Sep 10, 2021
  17. Junio C HamanoSep 10, 2021
  18. Philippe BlainSep 9, 2021
  19. Junio C HamanoSep 10, 2021
  20. Jeff KingSep 10, 2021

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.