hakanu / pervane

Plain text file based note taking and knowledge base building tool, markdown editor, simple browser IDE.
https://hakanu.github.io/pervane/
MIT License
202 stars 12 forks source link

Keep note histories #121

Open metanet opened 4 years ago

metanet commented 4 years ago
hakanu commented 4 years ago

where is the file going to be kept?

Some perceptual hash technique can be used to generate a hash out of the content and it will give different hash for different note contents while giving the same one for unchanged note. So that we won't need to count the lines or trust the length.

metanet commented 4 years ago

We can keep history files along with the original file. If the file name is "note.txt", history files could be like "note.md.history.1", "note.md.history.2", up to "node.md.N". We can hide these history files in the navigation tree.

About hashing, even if we change a single letter, we would get a different hash, therefore create a new history file. I think that could be overkill. Instead of that, we could create a new history file if the change is significant, for instance, at least N lines or %N percent of the file changed.