New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data modeling is not portable across backends #209
Comments
This is indeed a bug due to changing back and forth the behaviour between releases. I am now convinced that the proper behaviour is to disallow contents in the nodes, e.g. to look like a normal filesystem. The Thanks for the report! |
btw, 0.9.5 should be a bit better regarding the error message of the Git backend. |
The new behaviour is now much stricter:
This also needs a patch in |
One other possibility that crossed my mind last week was to allow any key to be used as a "file" and as a "directory". So, for example, you have the following operations Irmin.update "/fst" "ok"
Irmin.update "/fst/snd" "maybe" the filesystem this would produce is
While this makes for a slightly messier filesystem, it provides much more flexible API. I suppose one drawback of this approach is that the semantics of delete aren't completely obvious. |
It is not possible to test everything on a non-bare repository (as the paths might contain invalid characters for the given filesystem type), so adding a new test to check for regreession for mirage#209
This was indeed exactly like that at one point, but it causes all kinds of problems. I'm still unsure about the correct solution for this, but at least now it is consistant. |
👍 Feel free to close when the PR lands. |
The
Irmin_mem
backend allows the user to store values at any point within key hierarchy, while theIrmin_git.FS
backend does not. Rather than trying to describe the problem further in prose, consider the following pseudo-ish code:If
Store
is created from theIrmin_mem.Make
functor, then both operations will succeed. On the other hand, ifStore
is created from theIrmin_git.FS
functor, the second operation will fail with aUnix.Unix_error(Unix.ENOTDIR, "chdir", "/path/to/repo")
exception.The behavior I expected was for data modeling that I perform and verify to be correct using one backend will be just as correct when I switch to another backend. The behavior I observed was that this is not the case, at least for the in-memory and git backends.
I'm working with irmin
0.9.4
.The text was updated successfully, but these errors were encountered: