fangorn/ex_git_objectstore
public
ref:main
feat: git archive (tar/zip/bundle of a tree or commit) #39
open
Opened by cole.christensen@gmail.com
Links
No links yet.
Every hosting product has a "Download ZIP / tarball" button. We have no module for it.
Scope
ExGitObjectstore.Archive.tar_gz(repo, sha, opts)— stream a gzipped tar of the tree atsha.ExGitObjectstore.Archive.zip(repo, sha, opts)— stream a ZIP of the same.opts::prefix(directory prefix for entries),:format(tar, tar.gz, zip),:subtree(limit to a subpath).- Streaming output — don’t buffer the whole archive.
- Handle submodule gitlinks (skip or error — decide during impl).
- Handle symlinks, executable bits (mode encoding).
Acceptance
- Round-trip:
tar xzfon the output gives identical contents to whatObjectResolveryields for each path at that tree. - Interop: output byte-compatible with
git archive --format=tar.gzat least for trees without exotic modes (we don’t need to hit hash-identical since git’s timestamp field differs). - Memory bounded when archiving a 1 GB tree.