Use case: in-memory repository with references to on-disk database #124
jeffparsons
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Hi,
thanks for starting this conversation!
Even though there aren't many tools writing objects yet nor facilities to build trees from indices or other sources, there is a Write trait <https://github.com/Byron/gitoxide/blob/8b1043483cb46fd1b7f47a90c9dce24a65d58d1b/git-odb/src/write.rs#L5> which they all accept. It's implemented for loose objects or the sink, a /dev/null for objects. Based on the latter you could easily implement an in-memory object store.
Creating commits on the other hand is nothing gitoxide can help you with, yet, and it's probably further away given the current roadmap.
When thinking of the RAM disk approach I believe using git-alternates would be the way to go. Writes go into the RAM disk and reads are falling through to the original repository.
I hope that helps.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there! 👋
I was wondering whether you had any existing plan to support a use case that interests me: in-memory Git repositories. I'm specifically interested in using an in-memory repository to make new commits (or just tree objects), but referring to an existing on-disk repository for all older content.
The context for this is a tool where it would be most convenient for me to make "speculative" commits without writing them to disk and then only have to deal with Git trees, rather than having to deal with both Git trees and uncommitted on-disk changes.
My workaround for this would be to have the tool create a "RAM disk" and make a new repository there for the speculative commits.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions