threads / discuss / 61620

Question about Git protocol v2 status

Subject: Question about Git protocol v2 status

## tl;dr

2 messages between Jun 11, 2024 and Jun 11, 2024.

replies: 1people: 2as markdown or json

rlee· Jun 11, 2024, 00:21 UTC · lore
Hi all,
I've been looking into writing a custom Git remote helper. The man page for "gitremote-helpers" states that stateless-connect is used to connect to a Git server using v2 of the wire protocol, but that it is "Experimental; for internal use only." Moreover, the page describing protocol-v2 at https://git-scm.com/docs/protocol-v2 uses future tense, implying that v2 has not yet been finalized. However, the older blog post https://opensource.googleblog.com/2018/05/introducing-git-protocol-version-2.html states that v2 is expected to become part of Git v2.18 (with Git being many versions ahead of v2.18 by now), and my own testing shows that stateless-connect is used when performing Git operations via HTTPS with Github. Could I get some clarification on whether v2 is still experimental and on whether a custom gitremote-helper should declare (and implement) support for stateless-connect?
Thanks,
rlee287 [at] proton [dot] me
Jeff King· Jun 11, 2024, 09:26 UTC · re: rlee · lore

Re: Question about Git protocol v2 status

On Tue, Jun 11, 2024 at 12:21:26AM +0000, rlee wrote:
Show 14 quoted lines
> I've been looking into writing a custom Git remote helper. The man
> page for "gitremote-helpers" states that stateless-connect is used to
> connect to a Git server using v2 of the wire protocol, but that it is
> "Experimental; for internal use only." Moreover, the page describing
> protocol-v2 at https://git-scm.com/docs/protocol-v2 uses future tense,
> implying that v2 has not yet been finalized. However, the older blog
> post
> https://opensource.googleblog.com/2018/05/introducing-git-protocol-version-2.html
> states that v2 is expected to become part of Git v2.18 (with Git being
> many versions ahead of v2.18 by now), and my own testing shows that
> stateless-connect is used when performing Git operations via HTTPS
> with Github. Could I get some clarification on whether v2 is still
> experimental and on whether a custom gitremote-helper should declare
> (and implement) support for stateless-connect?

I think the docs are out of date. v2 is mature and has been the default since v2.29.0, courtesy of eb049759fb (protocol: re-enable v2 protocol by default, 2020-09-25).

The stateless-connect code is heavily exercised via git-remote-curl, but I suspect you may be the first other helper to use it. So it's possible you might find some corner cases. The point of it is mostly about turning the helper into a dumb pipe, so I'd be surprised if you found anything that caused us to rethink the helper interface there.

So my suggestion would be to work on it assuming that the interface is as documented, and let us know if you run into any problems (and likewise report success if you find it!).

-Peff

← back to recent threads