Commit Graph

34 Commits

Author SHA1 Message Date
Carlos Martín Nieto
fe4c72a811 Expose utility ref-type functions
These allow you to determine whether you're dealing with a branch, tag,
note or remote-tracking branch.
2014-02-15 01:38:33 +01:00
Carlos Martín Nieto
1a79093274 Get rid of a few dialyzer warnings 2014-02-14 00:51:06 +01:00
Carlos Martín Nieto
9501ed2377 Add reference has_log() 2014-02-13 14:53:19 +01:00
Carlos Martín Nieto
0d24afb089 Get rid of the tagged OID
This means we no longer accept any iolist in some of the functions,
but we might bring it back later.

There is also a new function, geef_ref:create_symbolic() to create
symbolic references, since we can no longer differentiate between a
name and an OID.
2013-09-03 20:37:00 +02:00
Carlos Martín Nieto
8f9ca440d9 Fix geef_ref:resolve/1
We never updated what the NIF returns, and we were making a lookup too
many by trying to load the reference which we already have.
2013-09-02 20:08:58 +02:00
Carlos Martín Nieto
808a8176bc Make dialyzer happy 2013-08-31 17:57:55 +02:00
Carlos Martín Nieto
70867b9615 Keep references purely in erlang
Refernces contain three pieces of data which we already keep in the
erlang record. Keep the repository it belongs to in the record as well
and remove resource in the NIF. This makes the code easier to reason
about, as we don't need to keep any reference counts or GC the C
struct.

This does mean we cannot re-use references across geef_repo restarts,
but that's probably a good thing.
2013-08-31 17:23:46 +02:00
Carlos Martín Nieto
da7a070522 A refname is always a binary 2013-08-31 14:49:11 +02:00
Carlos Martín Nieto
b04809ca59 Shuffle some types
Put types in the modules they belong to instead of including them in
each one from the header.
2013-08-31 14:43:25 +02:00
Carlos Martín Nieto
bd83f2fb0e Create a copy of the iterator before turning it into a stream
A functional language shouldn't modify the iterator, but instead keep
advancing. As we can't stop in any particular point, we still just use
a stream.
2013-08-12 14:20:13 +02:00
Carlos Martín Nieto
4c63c08c50 Refactor reference costructor 2013-08-11 00:46:20 +02:00
Carlos Martín Nieto
bb35fce5cc Implement ref iterators 2013-08-09 23:25:55 +02:00
Carlos Martín Nieto
6e24413388 geef_ref: fix typo in shorthand 2013-08-09 18:27:08 +02:00
Carlos Martín Nieto
73f31eac2f Make dialyzer happy 2013-07-31 05:00:23 +02:00
Carlos Martín Nieto
e8684471c0 Add ref shorthand function 2013-06-09 02:14:35 +02:00
Carlos Martín Nieto
042156d843 Bind ref name dwim 2013-06-07 17:55: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
8eaad74c3a Avoid going into the NIF for resolving an oid ref 2013-06-05 00:33:11 +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
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
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
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
65227fe85b Move nif functions to geef_nif 2013-04-25 11:05:57 +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
011068f51c Expose reference_name_to_id 2013-04-02 07:30:02 +02:00
Carlos Martín Nieto
ad567fbf41 erlang headers should be hrl 2013-01-29 01:46:11 +01:00
Carlos Martín Nieto
8a96f4732e Add the #oid{} record to differentiate from a formatted hash 2013-01-29 01:46:11 +01:00
Carlos Martín Nieto
5a58abc4a0 Let geef_ref:target/1 handle both oid and symrefs 2013-01-25 15:22:14 +01:00
Carlos Martín Nieto
78e0693b8a Add typespecs to the functions 2013-01-25 03:33:02 +01:00
Carlos Martín Nieto
7d76f18a55 More complete ref bindings 2013-01-24 23:55:42 +01:00
Carlos Martín Nieto
468695adb5 reference_id -> reference_target 2013-01-24 23:36:17 +01:00
Carlos Martín Nieto
ba92ce777f Even more erlang namespacing 2013-01-23 17:07:22 +01:00