I am currently working on a flashcard application where decks created by the user act as Git repositories. When a card is created in the app, a new file is committed to the repository, when a card is changed, the file is changed, and when a card is deleted--well, you get the point.
The file format that the application saves to is a gzipped Git repository, so at no point will I ever need to write the repository to disk. How can I best handle treating decks as a Git repository in this way?
Take a look at libgit2. It supports the in-memory git repository scenario and also has bindings to many languages:
https://libgit2.github.com
For example, by using rugged, the ruby binding for libgit2, you could do things like this:
a_backend = Rugged::InMemory::Backend.new(opt1: 'setting', opt2: 'setting')
repo = Rugged::Repository.init_at('repo_name', :bare, backend: a_backend)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With