Skip to content

Add self-contained Git bundle creation - #7434

Open
benjaminy wants to merge 3 commits into
libgit2:mainfrom
benjaminy:bundle-creation
Open

benjaminy wants to merge 3 commits into
libgit2:mainfrom
benjaminy:bundle-creation

Conversation

@benjaminy

Copy link
Copy Markdown
Contributor

PR description:

Follow-up to #7338. Add git_bundle_create to write self-contained bundles from explicitly selected references, completing the basic offline create-and-clone workflow.

  • Write v2 bundles for SHA-1 repositories and v3 bundles for SHA-256 repositories.
  • Include complete reachable history, preserving annotated tags and tag chains, including tag-only selections.
  • Advertise references in caller order, deduplicate repeated selections, and include HEAD only when explicitly selected.
  • Stream packbuilder output through atomic file replacement, with progress callbacks, cancellation, and cleanup on failure.
  • Reject shallow sources, invalid selections, and missing reachable objects.

Incremental creation, filtered bundles, and bundle-URI support remain out of scope.

This continues the bundle work originally proposed by Laurence McGlashan in #7101 and explored in #7221.

Validation

  • Warnings-as-errors build passes.
  • Bundle creation, parser, clone, fetch, transport-selection, and struct initialization tests pass.
  • Git interoperability checks pass for SHA-1 and SHA-256 bundles: git bundle verify, bare clone, git fsck --full, and complete parent history for branch and tag-only selections.
  • git diff --check passes.

Sanitizer and Windows validation remain outstanding.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant