Skip to content

B-ZDX9-backup-embed-a-git-library-instead-of-a-binary

Not scheduled. Related: T-UPPP-backup-bundle-git (ships a git binary in the app), B-NNS4-backup-off-machine-remote-with-full-history (needs push), M-PZGL.

determined-backup shells out to git, and T-UPPP-backup-bundle-git ships a pinned binary so the app does not depend on developer tools. A library linked into the app would remove the binary, the process spawns, the GIT_EXEC_PATH setup for helpers such as git-upload-pack, and the build-machine template path. git.rs is the only module that spawns git, so a swap is contained there.

git2 (libgit2)gix (gitoxide)
LicenseGPLv2 with a linking exceptionMIT or Apache-2.0
LanguageC library with Rust bindingsPure Rust
MaturityMature, stable APIPre-1.0; diff and status still moving
SpeedSlower than git on large reposFast
PushSupportedNot yet
Shallow clone over local transportUncertainTo check
Worktree staging and commitSupportedNeeds more code
Exec-path and templatesNot needed: no helper programs, no compiled-in template pathSame
  • lib.rs ties the crate to git’s text output: log --raw, diff-tree --numstat -z, ls-tree -r -l -z and others, checked by the parity cases. A library must reproduce numstat’s binary rule, --root’s all-added first commit and --no-renames.
  • The prune’s shallow clone needs an equivalent in the library.
  • Time list snapshots, stage and commit a snapshot, numstat for one snapshot, and a shallow prune on a store of about 5 GB, against the git CLI.
  • Check shallow clone from a local store and push from a shallow store, for both libraries.
  • Check the parity cases’ outputs can be reproduced.

← Back to Backlog