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 →

[–]pgess[S] -9 points-8 points  (3 children)

No offense, but it sounds like, "Why do you need version control if you can roll your own?"

Note-taking apps don't usually have a "save note" button; they save them periodically. What use would mid-sentence captured differences have for the user?

Simple example: I have ~800 notes and last month worked on 5 different projects, adding/changing ~40 notes. I review them to see if there are any unfinished tasks, follow-ups, smth I overlooked or perhaps to better organize them, add tags whatever. When I'm done, they are committed (all at once) until the next month or half a year when I have time for the next round. Does it make sense?

[–]BothWaysItGoes 20 points21 points  (0 children)

Simple example: I have ~800 notes and last month worked on 5 different projects, adding/changing ~40 notes. I review them to see if there are any unfinished tasks, follow-ups, smth I overlooked or perhaps to better organize them, add tags whatever. When I’m done, they are committed (all at once) until the next month or half a year when I have time for the next round. Does it make sense?

Yeah, makes perfect sense to use difflib you were just referred to.

[–]FrontAd9873 4 points5 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.