Commit 4fa3f00
fetch-pack: in protocol v2, in_vain only after ACK
When fetching, Git stops negotiation when it has sent at least
MAX_IN_VAIN (which is 256) "have" lines without having any of them
ACK-ed. But this is supposed to trigger only after the first ACK, as
pack-protocol.txt says:
However, the 256 limit *only* turns on in the canonical client
implementation if we have received at least one "ACK %s continue"
during a prior round. This helps to ensure that at least one common
ancestor is found before we give up entirely.
The code path for protocol v0 observes this, but not protocol v2,
resulting in shorter negotiation rounds but significantly larger
packfiles. Teach the code path for protocol v2 to check this criterion
only after at least one ACK was received.
Signed-off-by: Jonathan Tan <[email protected]>
Reviewed-by: Jonathan Nieder <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent d1185aa commit 4fa3f00
2 files changed
+27
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1143 | 1143 | | |
1144 | 1144 | | |
1145 | 1145 | | |
| 1146 | + | |
1146 | 1147 | | |
1147 | 1148 | | |
1148 | 1149 | | |
| |||
1157 | 1158 | | |
1158 | 1159 | | |
1159 | 1160 | | |
1160 | | - | |
| 1161 | + | |
1161 | 1162 | | |
1162 | 1163 | | |
1163 | 1164 | | |
| |||
1173 | 1174 | | |
1174 | 1175 | | |
1175 | 1176 | | |
1176 | | - | |
| 1177 | + | |
1177 | 1178 | | |
1178 | 1179 | | |
1179 | 1180 | | |
| |||
1230 | 1231 | | |
1231 | 1232 | | |
1232 | 1233 | | |
1233 | | - | |
| 1234 | + | |
| 1235 | + | |
1234 | 1236 | | |
1235 | 1237 | | |
1236 | 1238 | | |
| |||
1464 | 1466 | | |
1465 | 1467 | | |
1466 | 1468 | | |
| 1469 | + | |
1467 | 1470 | | |
1468 | 1471 | | |
1469 | 1472 | | |
| |||
1520 | 1523 | | |
1521 | 1524 | | |
1522 | 1525 | | |
1523 | | - | |
| 1526 | + | |
| 1527 | + | |
1524 | 1528 | | |
1525 | 1529 | | |
1526 | 1530 | | |
| |||
1533 | 1537 | | |
1534 | 1538 | | |
1535 | 1539 | | |
| 1540 | + | |
1536 | 1541 | | |
1537 | 1542 | | |
1538 | 1543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
388 | 406 | | |
389 | 407 | | |
390 | 408 | | |
| |||
0 commit comments