vrtmrz / obsidian-livesync

MIT License
3.96k stars 134 forks source link

Suggestion: Longer (or more organized) note history #321

Open Ellpeck opened 8 months ago

Ellpeck commented 8 months ago

Hi! I have a suggestion that may actually be very difficult to implement and so might not be something you're interested in (as I realize that it's not necessarily what this plugin is meant to be good at), but I thought I'd give it a shot anyway and see if maybe other users are also interested in a feature like this.

The current way the file history is implemented, it keeps the last 100 revisions of a note. If you have your LiveSync set to sync with the server very frequently and you edit a note for a long time straight, though, this history doesn't actually span a very long amount of time, and usually will just contain all the changes from the last 30 minutes or so.

I know that the current implementation is mostly meant to allow automatic merging of file histories and the like, but I think it would be very nice to expand this feature to also allow a longer and more organized history for the user. Specifically, I was thinking something similar to the way Nextcloud handles its file history, which, by default, is as follows:

The versioning app expires old versions automatically to make sure that the user doesn't run out of space. This pattern is used to delete old versions:

  • For the first second we keep one version
  • For the first 10 seconds Nextcloud keeps one version every 2 seconds
  • For the first minute Nextcloud keeps one version every 10 seconds
  • For the first hour Nextcloud keeps one version every minute
  • For the first 24 hours Nextcloud keeps one version every hour
  • For the first 30 days Nextcloud keeps one version every day
  • After the first 30 days Nextcloud keeps one version every week

The versions are adjusted along this pattern every time a new version gets created.

Obviously, LiveSync's version history doesn't have to use this exact pattern, but I think something similar would be very useful to people who might also be interested in keeping a log of the changes they have made to a file for a longer period of time.

davidzeng0 commented 8 months ago

Just another user here, I think the above is a good idea, and would also like to see unlimited history, if possible, just like git.

davidzeng0 commented 8 months ago

It would be nice if seamless integration with obsidian-git (https://github.com/vrtmrz/obsidian-livesync/issues/232) is possible

dlphnkck commented 8 months ago

Hi. Shouldn't that be a "backup"?

For example,

  1. My "File recovery" setup is to keep a 45-day history every 5 minutes. Image from Gyazo

  2. I also make backups several times a day for each desktop and mobile device, with generation management to HDD, FolderSync, etc. to cloud storage, etc.

Please also submit a Feature requests for the core plugin "File recovery" as well. Latest Feature requests topics - Obsidian Forum

Since this topic is not related to Issues, it might be a good idea to move it to the Discussion section?