Can gitoxide clone a repository in-memory? #829
-
Hello 👋 I run a service which clones repositories, performs analysis, and then outputs the result as a little badge on GitHub. One of the issues I constantly run into is that the Is it possible with the gitoxide's library APIs to clone a repository entirely in memory of the program? That would make it a lot easier and faster to clean up than using tmpfs. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
First of all, it's super interesting to hear that Right now, the answer to the question has to be "no", as it at some point wants to memory-map the fetched pack file. That requires it to be on disk. However, it should be straightforward to automate the deletion of intermediate files from Rust, but I suppose that's something you can already do. Once |
Beta Was this translation helpful? Give feedback.
First of all, it's super interesting to hear that
tmpfs
has quirks, I always thought that's obviously the way to do this and assumed perfection. I mean, it's RAM backed after all, but truly nothing is perfect apparently.Right now, the answer to the question has to be "no", as it at some point wants to memory-map the fetched pack file. That requires it to be on disk. However, it should be straightforward to automate the deletion of intermediate files from Rust, but I suppose that's something you can already do.
Once
gix-pack
actually works in WASM + WASI, I think it would be possible to forego memory mapping and use in-memory packs instead. You could experiment and see if it can be hacked…