I have kind of seen Git as two tightly coupled systems (and IIRC, other VCS's have modeled their design with a similar separation of concerns): a content addressable store, and a tagging/tracking system for metadata.
I actually kind of expected that someone would eventually try out replacing one of the two with their own "better" system to see how that worked out, but obviously the more interesting opportunity is to see if one or both of the components might be useful for an entirely different purpose.
If the API of the content-addressible-store library were standardized, one could even replace it with other backends (Plan9's Venti, or an object-store like S3 or Riak CS, or a DHT.) I could see it becoming sort of a libvirt thing.
This was my initial reasoning for making it. However when I began looking into it on Twitter @steveklabnik informed me that Rust's crates.io uses a similar system [0]. I found this especially intriguing, but have not gotten in touch with someone who knows the codebase better to give me some more insight.
[0] https://twitter.com/steveklabnik/status/608778665825083392
Graydon Hoare, one of the people behind Rust is the one of the people behind Monotone. Which was an inspiration for Git.
Can you elaborate upon this in the readme? It wasn't clear to me whether git, ruby or the gkv has the naive implementation (or if the conversion only happens with the string '1').
Also is it possible to enumerate the versions of key-values that have been saved?
I'm sure I have several more questions but I'll leave it at that. Thanks for making this!
The typing is governed by YAML standards. This is why symbols are left out. Since it uses `YAML.dump` and `YAML.load` with the set/get, it will automatically assume the string '1' is an integer, '1.0' a float, and so on.
> is it possible to enumerate the versions of key-values that have been saved?
Yes, using the `get_version` method, you could do something like:
all_items = $ITEMS[key].map { |hash| db.get(hash) }
I should add this as a normal function to the API. Its now on my todo list. user system total real
set: 0.150000 0.080000 0.230000 ( 1.093421)
hash set: 0.110000 0.120000 0.230000 ( 1.085441)
get: 0.150000 0.040000 0.190000 ( 1.091698)
hash get: 0.110000 0.060000 0.170000 ( 1.075470)In the process I found a bug in one of the Darwin syscalls. Still not fixed :(
Used in my website engine: https://github.com/myfreeweb/sweetroll
In a sense. $ITEMS is a hash ruby-object whose keys are what is set as the key by the input, but its values are the hashes that are stored in the git filesystem. There are about 10,000,000 improvements this could have and by no means would I consider it production quality software. Any ideas on a better means of persistance knowing this? Could back up the dict itself as a string in the git filesystem and have it be restorable on instantiation, possibly...
PS I emailed you the other day.