git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/9] fetch: further ref-prefix cleanups and optimizations

From
Jeff King <peff@peff.net>
Date
Mar 9, 2025, 03:01 UTC
Message-ID
<20250309030101.GA2334064@coredump.intra.peff.net>
In-Reply-To
<61147be4b9a0ee76f1fe0f3376d7316205da350c.1741389941.git.me@ttaylorr.com>
On Fri, Mar 07, 2025 at 06:27:03PM -0500, Taylor Blau wrote:
Show 9 quoted lines
> Peff and I talked about this today, and neither of us could find any
> reasons not to pursue the approach listed in the footnote of
> 
>   <20250221072558.GA572877@coredump.intra.peff.net>
> 
> , but this is a more conservative approach that should fix the issue and
> apply cleanly on top of 'maint'. It may be worth picking this into 2.49,
> even though we are already quite late into the -rc cycle, this is a
> fairly nasty bug.

Yeah, I favor doing this simple fix first, and then trying the larger (and slightly riskier) change on top.

I started to write up that larger patch, and found a number of interesting things. ;) So here's a 9-patch series, which would apply on top of tb/fetch-follow-tags-fix (but can very much wait to cook in the next development cycle).

  [1/9]: t5702: fix typo in test name
  [2/9]: t5516: prefer "oid" to "sha1" in some test titles
  [3/9]: t5516: drop NEEDSWORK about v2 reachability behavior
    Just some cosmetic fixes in nearby areas.
  [4/9]: t5516: beef up exact-oid ref prefixes test
    Improving test coverage in an area I'm about to touch.
  [5/9]: refspec_ref_prefixes(): clean up refspec_item logic
    Code clean-up. Not necessary (textually or semantically) for the
    other patches.
  [6/9]: fetch: ask server to advertise HEAD for config-less fetch
  [7/9]: fetch: stop protecting additions to ref-prefix list
  [8/9]: fetch: avoid ls-refs only to ask for HEAD symref update
    Here we get to the interesting bits. These get rid of the subtle
    dependency that led to this bug in the first place, and also
    optimize a few cases where we can narrow the ref advertisement.
    The third one is a bit optimization, where we avoid a whole
    round-trip to the server. It's correct as far as the rest of the
    code behaves, but I'm not 100% sure that the new origin/HEAD update
    feature isn't a little buggy. See my comments there.
  [9/9]: fetch: use ref prefix list to skip ls-refs
    And then this is just a final bit of cleanup enabled by the earlier
    patches.
 builtin/fetch.c        | 46 +++++++++++++++++-------------------------
 refspec.c              | 22 ++++++++++++++------
 t/t5516-fetch-push.sh  | 12 ++++++-----
 t/t5702-protocol-v2.sh | 44 +++++++++++++++++++++++++++++++++++++++-
 4 files changed, 85 insertions(+), 39 deletions(-)
-Peff
Previous: Bence FerdinandyNext: Jeff King
Message 10 of 61 in “Tags are no longer fetched when fetching specific commit”
  1. Igor TodorovskiJan 30, 2025
  2. Taylor BlauFeb 13, 2025
  3. Bence FerdinandyFeb 14, 2025
  4. Junio C HamanoFeb 14, 2025
  5. Jeff KingFeb 21, 2025
  6. fetch: fix following tags when fetching specific OIDTaylor Blau, Mar 7, 2025
  7. Taylor BlauMar 7, 2025
  8. Junio C HamanoMar 8, 2025
  9. Bence FerdinandyMar 8, 2025
  10. 0/9 fetch: further ref-prefix cleanups and optimizationsJeff King, Mar 9, 2025
  11. 1/9 t5702: fix typo in test nameJeff King, Mar 9, 2025
  12. Taylor BlauMar 12, 2025
  13. Jeff KingMar 13, 2025
  14. 2/9 t5516: prefer "oid" to "sha1" in some test titlesJeff King, Mar 9, 2025
  15. 3/9 t5516: drop NEEDSWORK about v2 reachability behaviorJeff King, Mar 9, 2025
  16. Taylor BlauMar 12, 2025
  17. 4/9 t5516: beef up exact-oid ref prefixes testJeff King, Mar 9, 2025
  18. 5/9 refspec_ref_prefixes(): clean up refspec_item logicJeff King, Mar 9, 2025
  19. Taylor BlauMar 12, 2025
  20. Jeff KingMar 13, 2025
  21. Junio C HamanoMar 13, 2025
  22. 0/4 refspec: treat 'fetch' as a Boolean valueTaylor Blau, Mar 17, 2025
  23. 1/4 refspec: treat 'fetch' as a Boolean valueTaylor Blau, Mar 17, 2025
  24. Jeff KingMar 18, 2025
  25. Jeff KingMar 18, 2025
  26. Taylor BlauMar 18, 2025
  27. 2/4 refspec: replace `refspec_init()` with fetch/push variantsTaylor Blau, Mar 17, 2025
  28. 3/4 refspec: remove refspec_item_init_or_die()Taylor Blau, Mar 17, 2025
  29. 4/4 refspec: replace `refspec_item_init()` with fetch/push variantsTaylor Blau, Mar 17, 2025
  30. Junio C HamanoMar 17, 2025
  31. Taylor BlauMar 18, 2025
  32. 0/4 refspec: treat 'fetch' as a Boolean valueTaylor Blau, Mar 18, 2025
  33. 1/4 refspec: treat 'fetch' as a Boolean valueTaylor Blau, Mar 18, 2025
  34. 2/4 refspec: replace `refspec_init()` with fetch/push variantsTaylor Blau, Mar 18, 2025
  35. 3/4 refspec: remove refspec_item_init_or_die()Taylor Blau, Mar 18, 2025
  36. 4/4 refspec: replace `refspec_item_init()` with fetch/push variantsTaylor Blau, Mar 18, 2025
  37. Elijah NewrenMar 19, 2025
  38. Taylor BlauMar 17, 2025
  39. Junio C HamanoMar 17, 2025
  40. Taylor BlauMar 18, 2025
  41. 6/9 fetch: ask server to advertise HEAD for config-less fetchJeff King, Mar 9, 2025
  42. Taylor BlauMar 12, 2025
  43. Jeff KingMar 13, 2025
  44. Junio C HamanoMar 13, 2025
  45. Taylor BlauMar 17, 2025
  46. 7/9 fetch: stop protecting additions to ref-prefix listJeff King, Mar 9, 2025
  47. Taylor BlauMar 12, 2025
  48. 8/9 fetch: avoid ls-refs only to ask for HEAD symref updateJeff King, Mar 9, 2025
  49. Junio C HamanoMar 13, 2025
  50. Jeff KingMar 17, 2025
  51. Junio C HamanoMar 17, 2025
  52. 0/2 limiting followRemoteHEAD being usedJeff King, Mar 18, 2025
  53. 1/2 fetch: only respect followRemoteHEAD with configured refspecsJeff King, Mar 18, 2025
  54. Taylor BlauMar 18, 2025
  55. 2/2 fetch: don't ask for remote HEAD if followRemoteHEAD is "never"Jeff King, Mar 18, 2025
  56. Junio C HamanoMar 18, 2025
  57. Taylor BlauMar 18, 2025
  58. 9/9 fetch: use ref prefix list to skip ls-refsJeff King, Mar 9, 2025
  59. Taylor BlauMar 12, 2025
  60. Taylor BlauMar 12, 2025
  61. Jeff KingMar 13, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.