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

Re: [PATCH] bundle-uri: copy all bundle references ino the refs/bundle space

From
Scott Chacon <schacon@gmail.com>
Date
Mar 1, 2025, 10:23 UTC
Message-ID
<CAP2yMa+YoxRaf48mS7mUbNnsfCm2Z=FT5Gohq_oWz0Q8XnH_eQ@mail.gmail.com>
In-Reply-To
<3a180cca-0573-474a-8835-8015dbe09541@gmail.com>
Hey,
On Wed, Feb 26, 2025 at 12:36 AM Derrick Stolee <stolee@gmail.com> wrote:
Show 6 quoted lines
>
> The intention of the design is to avoid having the bundle URI fetch
> changing tag refs, especially annotated tags. Those tag updates are
> expected to be advertised in the "git fetch" output. It would probably
> be best to peel the tag refs to a commit and then create a fake branch
> for the bundle.

The issue for this and also for the other suggestion you have later on is that I'm not sure how this can be easily done with the bundle command. It seems like everyone would have to write some sort of script to create a special type of bundle so that all these objects are referenced in a way that makes the bundle-uri helper actually get most of the objects that are needed.

Is there some option to rev-list that does this? Or are you saying it's better to write a script?

> The biggest question I had (and tried to get ahead of on the PR) is
> the use of a test to demonstrate what kind of bundle files cause this
> issue. It would be important to demosntrate that the repo is still
> usable if "refs/bundles/tags/v1.0" exists and points to a tag object.

I have written a test and I'll submit the new series in a minute, but I'm not sure what you mean by 'usable' in this context. Is there a situation where Git gets mad if there are annotated tags that aren't under refs/tags?

I have done these test clones and nothing bad seems to happen having them in refs/bundle/tags/v1.0 that I notice, but I don't know how to write a test that specifically verifies that.

> So I'm OK with relaxing this to be more flexible, but I'm not sure
> why the bundles couldn't be created using "refs/heads/", possibly via
> changing the ref names during bundle creation.

So same point here. I think the bundle-uri functionality isn't particularly effective if the creation of the bundle needs special scripts to create in a way that is expected.

One other approach would be to add an option to `git bundle` that does this sanitization (unpeeling things into fake branch heads), like some `--bundle-for-uri`, but I feel like just using `--all` and having the clone handle it in the way I proposed might be much simpler and more usable.

We could also immediately delete everything under `refs/bundle/tags` after the fetch if we don't like them there, but still having them be available for the fetch negotiation.

I'll send a new series with the existing tests updated to look for `refs/bundle/heads/*` instead of `refs/bundle/*` and adding a very simple test to see that the tags were unpacked as the next step.

Scott
Previous: Derrick StoleeNext: Junio C Hamano
Message 4 of 37 in “bundle-uri: copy all bundle references ino the refs/bundle space”
  1. bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Feb 25, 2025
  2. Junio C HamanoFeb 25, 2025
  3. Derrick StoleeFeb 25, 2025
  4. Scott ChaconMar 1, 2025
  5. Junio C HamanoMar 3, 2025
  6. Derrick StoleeMar 3, 2025
  7. 0/3 bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Mar 1, 2025
  8. 1/3 bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Mar 1, 2025
  9. 2/3 bundle-uri: update bundle clone tests with new refspec pathScott Chacon via GitGitGadget, Mar 1, 2025
  10. 3/3 bundle-uri: add test for bundle-uri clones with tagsScott Chacon via GitGitGadget, Mar 1, 2025
  11. Derrick StoleeMar 3, 2025
  12. 0/2 bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Mar 18, 2025
  13. 1/2 bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Mar 18, 2025
  14. Phillip WoodMar 19, 2025
  15. 2/2 bundle-uri: add test for bundle-uri clones with tagsScott Chacon via GitGitGadget, Mar 18, 2025
  16. Phillip WoodMar 19, 2025
  17. Taylor BlauMar 19, 2025
  18. Toon ClaesApr 14, 2025
  19. Scott ChaconApr 25, 2025
  20. Junio C HamanoMar 21, 2025
  21. 0/2 bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Apr 25, 2025
  22. 1/2 bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Apr 25, 2025
  23. 2/2 bundle-uri: add test for bundle-uri clones with tagsScott Chacon via GitGitGadget, Apr 25, 2025
  24. Scott ChaconApr 25, 2025
  25. Phillip WoodApr 25, 2025
  26. Junio C HamanoApr 25, 2025
  27. 0/2 bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Apr 25, 2025
  28. 2/2 bundle-uri: add test for bundle-uri clones with tagsScott Chacon via GitGitGadget, Apr 25, 2025
  29. 1/2 bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Apr 25, 2025
  30. 0/2 bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Apr 25, 2025
  31. 1/2 bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Apr 25, 2025
  32. 2/2 bundle-uri: add test for bundle-uri clones with tagsScott Chacon via GitGitGadget, Apr 25, 2025
  33. 0/2 bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Apr 25, 2025
  34. 2/2 bundle-uri: add test for bundle-uri clones with tagsScott Chacon via GitGitGadget, Apr 25, 2025
  35. 1/2 bundle-uri: copy all bundle references ino the refs/bundle spaceScott Chacon via GitGitGadget, Apr 25, 2025
  36. Junio C HamanoApr 25, 2025
  37. Phillip WoodApr 29, 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.