Reputation: 2953
Can git clone benefit from http2?
I do always prefer ssh over http(s) because of various network errors but also ssh seems to be a bit faster than http(s). So my question is: Could git, especially clone, benefit from http2 s multiplexing functionality for example?
Upvotes: 3
Views: 778
Reputation: 1327584
This (http2 support) wasn't discussed much in the mailing list.
The only occurrence was about a GSoC 2015 project about git fetch:
Due to http limitations and stateless decision, a lot of data is sent back and forth during have/want negotiation for smart-http. I wonder if we could implement the "long polling" scheme in a CGI program. The program terminates HTTP requests and recreates a full duplex connection for upload-pack to talk to the client. upload-pack falls back to the normal mode, used by git:// and ssh://.
So basically Git-over-TCP-over-HTTP? :)
Yes. The hidden agenda was, if it works well, we might be able to deprecate smart-http one day. That day, if happens, would be in far future though. By that time hopefully we could just use http2 insteadof tcp-over-http1.
So yes, it could benefit Git, but its implementation is not yet actively pursued.
Upvotes: 1
Reputation: 31087
The smart protocol over HTTP uses a few long-running requests; HTTP/2 would not benefit dramatically here.
By contrast, the dumb protocol makes far more separate requests, and could benefit. However:
The dumb protocol is fairly rarely used these days. It’s difficult to secure or make private, so most Git hosts (both cloud-based and on-premises) will refuse to use it.
In practice, without designing a new protocol to take advantage of HTTP/2, I would expect SSH to continue to give the best results.
Upvotes: 2