lmms icon indicating copy to clipboard operation
lmms copied to clipboard

Add simple versioned autosave.

Open Jan125 opened this issue 2 months ago • 7 comments

Each autosave now adds a patterned file based on the time, to have a version history of sorts.

I wager that people who have autosaves turned on will not be affected by too many files.

Jan125 avatar Oct 08 '25 20:10 Jan125

I wager that people who have autosaves turned on will not be affected by too many files.

I think there are users that have autosave turned on, but do not really care for the entire history of the project each time it is saved and would only want the latest version.

sakertooth avatar Oct 08 '25 22:10 sakertooth

I wager that people who have autosaves turned on will not be affected by too many files.

I think there are users that have autosave turned on, but do not really care for the entire history of the project each time it is saved and would only want the latest version.

maybe there could be an option to choose between the entire history of the project to just the latest save. Maybe like the past 3 saves could be kept. The user would be able to choose, however.

JMii63 avatar Oct 09 '25 15:10 JMii63

I'll see if I can understand the option stuff and GUI, and will add a checkbox next to enabling autosaves next. Unsure if I trust myself with adding only keeping a specific amount of autosaves.

Jan125 avatar Oct 09 '25 19:10 Jan125

I'll see if I can understand the option stuff and GUI, and will add a checkbox next to enabling autosaves next. Unsure if I trust myself with adding only keeping a specific amount of autosaves.

i mean like a slider that goes between keeping only the latest save and keeping all saves.

JMii63 avatar Oct 10 '25 00:10 JMii63

Would adding an autosave file limit be too much for this PR? I agree that many users wouldn't mind having a ton of autosave files lying around, but having LMMS clean them up with a set limit should be a consideration. Plus, some users do mind their file counts

image

headquarter8302 avatar Oct 16 '25 09:10 headquarter8302

Having a full version history would be very helpful (and eventually obsolete the "Save as new version" action), so I'm very much on board with this.
I did a quick ls -lRS on my LMMS project folder and the biggest project file I have is around 100kB (and that one's an outlier, the average is around 40kB).

So my most conservative estimate on my machine is that, if all project files were that big, the size of all version history snaphots would be around 60MB per project after 10h of work at one autosave every minute. Not too much overall, but significant enough that a cleanup function would make sense.

I see an issue with the idea of making this a GUI slider that the user can modify at any time though: Let's say you already have a project with a version history of 100 files, then you change that GUI slider from "keep all files" to "keep the last 3 versions" and then you open the project with that full history. What happens on the next timer-triggered autosave? Does the version history get wiped out?

irrenhaus3 avatar Oct 16 '25 10:10 irrenhaus3

Thoughts: -Should rearrange format to be yyyy-mm-dd_hh-mm-ss. -Maybe putting these just into a folder structure like projectname.mmp(z).autosaves/yyyy-mm-dd_hh-mm-ss.mmp(z) would make sense?

Jan125 avatar Dec 08 '25 16:12 Jan125