Skip to content

Commit 684ceae

Browse files
jrngitster
authored andcommitted
fetch: default to protocol version 2
The Git users at $DAYJOB have been using protocol v2 as a default for ~1.5 years now and others have been also reporting good experiences with it, so it seems like a good time to bump the default version. It produces a significant performance improvement when fetching from repositories with many refs, such as https://chromium.googlesource.com/chromium/src. This only affects the client, not the server. (The server already defaults to supporting protocol v2.) The protocol change is backward compatible, so this should produce no significant effect when contacting servers that only speak protocol v0. Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 33166f3 commit 684ceae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Documentation/config/protocol.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protocol.version::
4848
If set, clients will attempt to communicate with a server
4949
using the specified protocol version. If the server does
5050
not support it, communication falls back to version 0.
51-
If unset, the default is `0`.
51+
If unset, the default is `2`.
5252
Supported versions:
5353
+
5454
--

protocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ enum protocol_version get_protocol_version_config(void)
3939
return env;
4040
}
4141

42-
return protocol_v0;
42+
return protocol_v2;
4343
}
4444

4545
enum protocol_version determine_protocol_version_server(void)

0 commit comments

Comments
 (0)