OpenBagTwo / gsb

A tool for managing incremental backups of your save states using Git!
https://openbagtwo.github.io/gsb/
GNU General Public License v3.0
0 stars 0 forks source link

Backup exporter #10

Closed OpenBagTwo closed 9 months ago

OpenBagTwo commented 1 year ago

GIVEN Steve wants to export a specific backup of a specific save state (my-save) at a specific time AND he doesn't want that export to include the full history attached

WHEN he runs the command gsb export my-save [tag-name-or-commit-hash] (or omits that argument to just use the current state)

THEN a file should be generated in the current working directory named my-save.<tag-name-or-commit-hash>.zip* containing a static snapshot of the specified backup

SO that he can take that export and use it on another machine, upload it to a bug-tracker for diagnostics, safely dissect it, or put it into some cold storage medium without having to run the git command manually

Notes

OpenBagTwo commented 9 months ago

So pygit2's write_archive method only supports tarfiles. This means that in order to support zip gsb will either:

  1. need to convert a tarball to a zip archive
  2. create a translation wrapper around ZipFile that implements the tarfile methods called by write_archive
  3. Implement my own write_archive

I was originally thinking about (2), but honestly that's going to be extremely brittle unless I pin the version of pygit2.