10000 bundle: Add bundle transport and test cloning from a bundle by lrm29 · Pull Request #7101 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content

bundle: Add bundle transport and test cloning from a bundle #7101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lrm29
8000
Copy link
Contributor
@lrm29 lrm29 commented Jun 30, 2025

Enables cloning and fetching from bundles.

I implemented it as a new "transport", so the entry point is in transport_find_fn, where we check if a local file is a bundle (but only after we have attempted to find other transport options).

The documentation I used to implement this is here:

Git: Bundle File Format Documentation
Git: Bundle Documentation

Still Todo:

  • Enforce the prerequisite commits when present. I think this would be done in bundle_negotiate_fetch.
  • Add a libgit2 API to create bundles.
  • Show progress reading the pack?

Some puzzles:

  • I had to add "sort_head_to_front" as clients of ls_remote such as local clone require HEAD to be the first in the list.
  • read_until_packfile felt a bit dirty/inefficient reading byte-by-byte until the double newline, which denotes the start of the packfile.

Closes #6824 and #1718.

@lrm29 lrm29 force-pushed the bundle_clone branch 6 times, most recently from a997ee6 to 877a3ae Compare July 1, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3BA8
Development

Successfully merging this pull request may close these issues.

Support for bundle create, fetch, clone
1 participant
0