Commit e00dfdb
committed
fetch-pack: respect fetch.haveRefs
The previous change documented and loaded the fetch.haveRefs
multi-valued config, but did not change any behavior. Now, let's update
the behavior for fetch negotiation.
This is a config-only option right now, unlike the --negotiation-tips
command-line options. For this reason, the values are read on-demand
from the repo_settings struct instead of passed down via options. If we
wish to reflect this option in the command line as well, then that
plumbing would be easy to refactor.
One interesting aspect is how this relates to --negotiation-tips
arguments. The --negotation-tips arguments _restricts_ the set of haves
while the fetch.haveRefs configs _increases_ the set of haves. I chose
to have these options done in that order. This helps create tests by
enforcing that the negotiation strategy restricts the set of haves
before the config adds them back in. This provides some simulation of
the intended use case where the haves were restricted due to an
overwhelming number of refs instead of by --negotiation-tips.
The set of fetch.haveRefs are output entirely before considering a batch
for flushing. This should hopefully not be a problem as users _should_
select a small core set of references. While these are output, we add
them to an oidset to avoid duplicates.
During my development, I found that if I try to increment the counters
while outputting these ref tips, then I could get into an infinite loop
where the client and server go back and forth forever. This happened
when the fetch.haveRefs included the entire set of references that could
be selected, which is covered in the tests.
Signed-off-by: Derrick Stolee <stolee@gmail.com>1 parent 37fe8bd commit e00dfdb
File tree
6 files changed
+191
-6
lines changed- Documentation
- config
- builtin
- t
6 files changed
+191
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
332 | 334 | | |
333 | 335 | | |
334 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
335 | 371 | | |
336 | 372 | | |
337 | 373 | | |
| |||
347 | 383 | | |
348 | 384 | | |
349 | 385 | | |
| 386 | + | |
350 | 387 | | |
351 | 388 | | |
352 | 389 | | |
| |||
474 | 511 | | |
475 | 512 | | |
476 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
477 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
478 | 534 | | |
479 | 535 | | |
480 | 536 | | |
| |||
584 | 640 | | |
585 | 641 | | |
586 | 642 | | |
| 643 | + | |
587 | 644 | | |
588 | 645 | | |
589 | 646 | | |
| |||
1305 | 1362 | | |
1306 | 1363 | | |
1307 | 1364 | | |
1308 | | - | |
| 1365 | + | |
| 1366 | + | |
1309 | 1367 | | |
1310 | 1368 | | |
1311 | 1369 | | |
1312 | 1370 | | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
1313 | 1381 | | |
| 1382 | + | |
| 1383 | + | |
1314 | 1384 | | |
1315 | 1385 | | |
1316 | 1386 | | |
| |||
1358 | 1428 | | |
1359 | 1429 | | |
1360 | 1430 | | |
1361 | | - | |
| 1431 | + | |
| 1432 | + | |
1362 | 1433 | | |
1363 | 1434 | | |
1364 | 1435 | | |
| |||
1413 | 1484 | | |
1414 | 1485 | | |
1415 | 1486 | | |
1416 | | - | |
| 1487 | + | |
| 1488 | + | |
1417 | 1489 | | |
1418 | 1490 | | |
1419 | 1491 | | |
| |||
1657 | 1729 | | |
1658 | 1730 | | |
1659 | 1731 | | |
| 1732 | + | |
1660 | 1733 | | |
1661 | 1734 | | |
1662 | 1735 | | |
| |||
1708 | 1781 | | |
1709 | 1782 | | |
1710 | 1783 | | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
1711 | 1788 | | |
1712 | 1789 | | |
1713 | 1790 | | |
| |||
1747 | 1824 | | |
1748 | 1825 | | |
1749 | 1826 | | |
1750 | | - | |
| 1827 | + | |
| 1828 | + | |
1751 | 1829 | | |
1752 | 1830 | | |
1753 | 1831 | | |
| |||
1883 | 1961 | | |
1884 | 1962 | | |
1885 | 1963 | | |
| 1964 | + | |
1886 | 1965 | | |
1887 | 1966 | | |
1888 | 1967 | | |
| |||
2187 | 2266 | | |
2188 | 2267 | | |
2189 | 2268 | | |
| 2269 | + | |
2190 | 2270 | | |
2191 | 2271 | | |
2192 | 2272 | | |
| |||
2205 | 2285 | | |
2206 | 2286 | | |
2207 | 2287 | | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
2208 | 2292 | | |
2209 | 2293 | | |
2210 | 2294 | | |
| |||
2221 | 2305 | | |
2222 | 2306 | | |
2223 | 2307 | | |
2224 | | - | |
| 2308 | + | |
| 2309 | + | |
2225 | 2310 | | |
2226 | 2311 | | |
2227 | 2312 | | |
| |||
2273 | 2358 | | |
2274 | 2359 | | |
2275 | 2360 | | |
| 2361 | + | |
2276 | 2362 | | |
2277 | 2363 | | |
2278 | 2364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1728 | 1728 | | |
1729 | 1729 | | |
1730 | 1730 | | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
1731 | 1809 | | |
1732 | 1810 | | |
1733 | 1811 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
257 | 272 | | |
258 | 273 | | |
259 | 274 | | |
| |||
0 commit comments