3 ms·
How so? Filesystem operations are (or can be) atomic too.
by CyberShadow 9y ago
How so? Filesystem operations are (or can be) atomic too.
- vog 9y agoGit operations are not atomic, though. This is a huge implementation flaw, if not design flaw. I had it several times that my laptop (or a VM) crashed during or short after a git commit, before it was fully written from cache to disk. The reasons vary, sometimes the VM disk was full, or some tests ran parallel to the commit that consumed too much RAM. This doesn't happen often, but every few months. Meanwhile I "solved" this issue by making sure that the system is never in any form "stressed" while I work with Git. Whatever the reason: The result is a broken Git repository that is so non-trivial to fix, that it was easier to clone it fresh from server and apply the missing changes again from the left-over local file of the broken repo.
- orf 9y agoYou can very easily write a sqlite backend if you want. There are a bunch of interesting ones for libgit2[1][2] 1. https://www.perforce.com/blog/your-git-repository-database-pluggable-backends-libgit2 https://www.perforce.com/blog/your-git-repository-database-p... 2. https://github.com/libgit2/libgit2-backends/blob/master/sqlite/sqlite.c https://github.com/libgit2/libgit2-backends/blob/master/sqli...