Git makes transport packfile generation pluggable
Patrick Steinhardt routes fetch, push, and bundle packing through a new object-database interface so alternate backends need not pretend to be the files store.
Git is gaining a pluggable interface for generating packfiles on the transport path, so fetch, push, and bundle creation no longer hard-code the traditional on-disk object store.
Patrick Steinhardt posted a revised series that introduces an object-database callback for producing packs and switches git-upload-pack, git-send-pack, and git-bundle to use it. Until now those tools spawned git-pack-objects directly, baking in the assumption that the repository’s objects lived in the classic "files" backend. That blocked alternate object-database implementations from participating cleanly in network transfers and bundle export.
The change deliberately covers only the transport use of packs. Packfiles serve two roles in Git: durable storage inside a repository, and a wire format for moving objects between repositories. Storage-side packing, driven by repack and related maintenance, stays tied to backend-specific options (cruft packs, keep packs, loose-object handling, and the like). Maintenance is already pluggable on its own path; Steinhardt left that machinery alone rather than force every backend to implement options that only make sense for the files layout.
git-pack-objects itself remains unusable with alternate backends. Steinhardt called fully generalizing it an "utter mess" because of those storage-specific knobs, and sketched a longer-term plan: a git-objects command, analogous to git-refs, that would own object-database operations and expose generic pack generation without the historical baggage.
For the files backend the new interface still drives pack-objects under the hood, with options limited to what upload-pack, send-pack, and bundle actually need. Reviewers including Elijah Newren and Karthik Nayak worked through edge cases such as child-process cleanup on abnormal exit and which source is treated as primary when generating packs. The series is the next concrete step in Git’s multi-year effort to treat the object database as a replaceable component rather than a fixed directory layout.