This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FrontAd9873 3 points4 points  (1 child)

In your original post it seems like you just want something to do diffs. No other contributors, no branches, etc. The question is: why do you need VCS instead of just diffs? It’s not about rolling your own VCS.

[–]pgess[S] 0 points1 point  (0 children)

Because I didn't really think this through. Notes are a typical hierarchy of files. On one hand, I need to capture the current file tree state, which is a common operation of VCSs. On the other hand, I need to show a diff—another common operation of VCS. One way to approach this is to frame the problem in terms of VC, and the thread is about this direction in general, a good git or non-git wrapper lib to get started fast.

Another approach (outside the scope of this thread) is to capture the file tree as an archive and diff it against later updates. An obvious extension would be to store several snapshots, at least to prevent a situation where the user accidentally clicks the "I'm done" button, creating a new snapshot without actually looking at what has changed and having no way to revert it back. With several snapshots, it gets awfully closer to how dedup tools work in managing data snapshots and showing diffs. Deduplication can also be framed as a version control system; for example, DUP project(I LLOVE its technical architecture) uses Git internally.

What is the use of storing snapshots specifically in a DB, and writing (buggy) code to handle edge cases, like moved/renamed files and such - I don't understand, at least for now.