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

gsb backup --tag "overwrites" previous tagged backup #32

Closed OpenBagTwo closed 9 months ago

OpenBagTwo commented 9 months ago

Summary

When the last backup was a tagged backup and there are no changes, running gsb backup --tag "message" will create a new tag pointing to the same commit as the last tag. Meaning that subsequent calls of gsb history will only show the new tag.

Environment and Version

Steps to Reproduce

  1. Create a tagged backup
    gsb backup --tag "Hi mom"
  2. Without making any changes, create a new tagged backup
    gsb backup --tag "Hi dad"
  3. Run gsb history -v

The output will only show the "Hi dad" backup with the actual tagname corresponding to the date of that backup, but the timestamp of the backup corresponding to when the "Hi mom" backup was created, e.g.

  1. gsb2023.09.30+143149 from 2023-09-27-18:36:02 Full reference: 6bbd373d77da885b1e58e053e5f86f9c2299c47f Hi dad

Workaround

So technically this is an issue in gsb history where it performs the commit -> tag lookup:

https://github.com/OpenBagTwo/gsb/blob/4847bae3d9db3b9643a1994ca803036165fdb020/gsb/history.py#L68-L70

No commits or tags have been deleted. Thus, I was able to clean up this mess by running:

git tag -d gsb2023.09.30+143149

after which gsb history -vvn1 correctly showed:

  1. gsb2023.09.27+183606 from 2023-09-27-18:36:02 Full reference: 6bbd373d77da885b1e58e053e5f86f9c2299c47f Hi mom

Severity

Annoying

Desired Outcome

Fix: desired behavior is that if there are no new changes and the last backup was "tagged" then the backup should cancel with a "no new changes" message.

There may be a use-case for a gsb backup --edit-annotation method, but that's out-of-scope

Urgency

By next major release (though I'm provisionally assigning this to the scope for v0.0.3)

Notes