Commit Graph

226 Commits

Author SHA1 Message Date
Carlos Martín Nieto
d21d2cb9b0 Keep an object's id in the record
We have the information there anyway, so don't make us allocate a new
binary every time.
2013-06-05 22:15:40 +02:00
Carlos Martín Nieto
525fae1ee6 Don't forget mix.exs 2013-06-05 21:42:47 +02:00
Carlos Martín Nieto
133c1004ea Rename the object module to geef_obj
This leaves us geef_object as the record to match against.
2013-06-05 21:42:16 +02:00
Carlos Martín Nieto
ac3d2d03fe Rename the ref record to geef_reference
Remove the access hacks for elixir and make :geef_reference an elixir
macro as well.
2013-06-05 21:22:25 +02:00
Carlos Martín Nieto
1df7939d4c Better elixir example in README 2013-06-05 01:49:31 +02:00
Carlos Martín Nieto
9f82af2ac3 Add odb and reference wrappers 2013-06-05 01:40:08 +02:00
Carlos Martín Nieto
21c5c8ca2d Add experimental elixir Geef.Repository wrapper 2013-06-05 00:57:19 +02:00
Carlos Martín Nieto
370acd05ce More correct spec for pkt 2013-06-05 00:33:11 +02:00
Carlos Martín Nieto
8eaad74c3a Avoid going into the NIF for resolving an oid ref 2013-06-05 00:33:11 +02:00
Carlos Martín Nieto
9f500e3fa0 Release binaries after creating writable copy 2013-06-04 23:37:03 +02:00
Carlos Martín Nieto
369a2e5151 Add convenience geef_pkt:line([]) -> [] 2013-06-02 00:02:11 +02:00
Carlos Martín Nieto
bd510de1e3 Also parse "done" lines
This works well for now, but if we're going to support
multi_ack_detailed at some point, we need a better way of parsing the
particular pkt.
2013-05-31 14:21:59 +02:00
Carlos Martín Nieto
3ec3c454c8 geef_object:type/1 helper for elixir 2013-05-30 03:50:45 +02:00
Carlos Martín Nieto
0e644be825 Add tag-peeling support 2013-05-30 03:39:51 +02:00
Carlos Martín Nieto
f410083711 Simplify the pkt parsing code 2013-05-28 19:45:37 +02:00
Carlos Martín Nieto
75e3d5416c Better handling of flush, short lines 2013-05-28 17:57:45 +02:00
Carlos Martín Nieto
ecb7cdfc23 Parse protocol requests 2013-05-28 09:21:24 +02:00
Carlos Martín Nieto
03f43d3265 pkt: parse want and have lines 2013-05-27 12:55:04 +02:00
Carlos Martín Nieto
23baf9a8b0 Fix pkt-line length 2013-05-27 12:55:04 +02:00
Carlos Martín Nieto
dacbbbc20e Add a simple protocol helper 2013-05-27 12:55:04 +02:00
Carlos Martín Nieto
523b20d70a ref: return {ok, Name} tuple for the name in the NIF 2013-05-27 12:55:04 +02:00
Carlos Martín Nieto
b79c606725 Remove references to ref type filtering 2013-05-27 12:55:04 +02:00
Carlos Martín Nieto
2ebfc7b4d3 Complete the definition of the index_entry record
Most of the values are ignored, though
2013-05-27 12:55:04 +02:00
Carlos Martín Nieto
7b1dacffc7 Convert geef_odb to a gen_server 2013-05-23 10:58:11 +02:00
Carlos Martín Nieto
41113f3221 Rename geef_oid:fmt -> hex 2013-05-13 11:49:49 +02:00
Carlos Martín Nieto
604388a76d Keep the reference name as part of the record 2013-05-13 11:46:12 +02:00
Carlos Martín Nieto
dfdb4cbb54 README: use highlighted code block, talk about elixir 2013-05-13 11:06:37 +02:00
Carlos Martín Nieto
4a2f2e8ab2 Namespace the records
This makes it useful for users of the bindings. The naming is the same
as the module to allow elixir to treat the records in much the same
way as its native module/record hybrid.
2013-05-13 11:05:59 +02:00
Carlos Martín Nieto
cc8124a6b9 Accept an iolist in the revwalk 2013-05-12 15:02:54 +02:00
Carlos Martín Nieto
75c591a089 Forgot to move one call to geef_nif 2013-05-12 15:02:31 +02:00
Carlos Martín Nieto
1077a055dc Remove geef_ref:target/1, use the record 2013-05-11 04:01:55 +02:00
Carlos Martín Nieto
d84338742e Update README 2013-05-10 12:14:58 +02:00
Carlos Martín Nieto
1621871387 Simpify rm_r 2013-05-04 01:05:35 +02:00
Carlos Martín Nieto
fc80d6d836 Rename geef_tree:bypath -> get 2013-05-04 00:25:06 +02:00
Carlos Martín Nieto
3f4d51c0e1 Simple version of index_add 2013-05-03 23:42:49 +02:00
Carlos Martín Nieto
a5bbfa681b Use the right function for the index ctor 2013-05-03 23:22:11 +02:00
Carlos Martín Nieto
b420b61c19 Clean up after the repo tests 2013-05-02 19:40:01 +02:00
Carlos Martín Nieto
616a358dc7 Prefer binary realloc to self-managed buffers
Use erlang's allocator and simplify the code by writing into the
buffer we're going to give back anyway.

Also introduce a function to NUL-terminate iolist buffers, which can
avoid memory copying.
2013-05-02 13:16:02 +02:00
Carlos Martín Nieto
ef7d2d5490 Return {error, enonmem} in OOM situations 2013-05-02 11:51:28 +02:00
Carlos Martín Nieto
0aa11d8532 Allow creation of refs 2013-05-02 06:24:15 +02:00
Carlos Martín Nieto
9d7139d604 ref: store the target in the record
There's no need to create a new object every time the user asks for
the target, so store it the same way we do for the type.
2013-05-02 03:53:07 +02:00
Carlos Martín Nieto
0127730f6b Add geef_index:read_tree() 2013-04-26 14:34:15 +02:00
Carlos Martín Nieto
0a71085a40 Introduce geef_index 2013-04-26 11:47:40 +02:00
Carlos Martín Nieto
65227fe85b Move nif functions to geef_nif 2013-04-25 11:05:57 +02:00
Carlos Martín Nieto
54d9e8b63a Add lookup/2 to the specific types
They proxy to geef_object:lookup/3 which looks up the object and
asserts the type.
2013-04-22 02:13:24 +02:00
Carlos Martín Nieto
3adfa507c0 Fix geef_ref:lookup/2
Make use of the repo server intead of accepting a handle
2013-04-21 20:35:21 +02:00
Carlos Martín Nieto
353995a2da Properly stop the repo and revwalk servers
Return the 4-tuple when asked to stop instead of the 3-tuple so we do
indicate the stop was normal.
2013-04-10 20:11:07 +02:00
Carlos Martín Nieto
d0034b1142 Add a test for revwalk 2013-04-10 19:08:05 +02:00
Carlos Martín Nieto
7a1a079a5a Make revwalk a gen_server 2013-04-10 15:20:46 +02:00
Carlos Martín Nieto
4f507b8146 Make the repo a gen_server
This helps us make sure we only have one thread accessing a particular
repo at a time and hopefully help us be more in line with usual erlang
practices.
2013-04-06 18:34:02 +02:00