Commit Graph

129 Commits

Author SHA1 Message Date
Carlos Martín Nieto
fffdb47032 Make Reference call the NIF itself 2014-08-03 02:10:42 +02:00
Carlos Martín Nieto
808646a5ca Work towards elixir 14
While here, make the object be an elixir struct instead of delegating to
the erlang code.

As part of this, geef_nif:commit_tree() has been fixed to return the id,
insted of the type, as we know it's going to be a tree, but not then id.
2014-08-03 01:03:17 +02:00
Carlos Martín Nieto
8ade44a868 config: string get/set 2014-05-19 13:11:55 +02:00
Carlos Martín Nieto
4b0379f3ee config: expose get_bool/2 2014-05-19 12:55:12 +02:00
Carlos Martín Nieto
d6ad01836f config: another failing test 2014-05-19 12:50:53 +02:00
Carlos Martín Nieto
f568955a95 config: test for setting and getting bool 2014-05-19 12:40:55 +02:00
Carlos Martín Nieto
29d468c90a Add missing files 2014-05-19 12:15:14 +02:00
Carlos Martín Nieto
98b176c925 Add a minimum of config
This lets us revive the reflog test by letting us set
core.logallrefupdates to true.
2014-05-18 12:03:53 +02:00
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
73af429633 Add geef_reflog:delete() 2014-02-13 18:26:33 +01:00
Carlos Martín Nieto
5520efb72a Correct the signature output from the reflog
The function to convert signatures into erlang terms was returning ok
with the rest of the tuple which geef_sig expects. We do not want the
ok there, so let that function give us the four terms and decide what to
do in each case.

The signature functions still want to return with ok before it, but the
reflog wants them together with the other parameters.
2014-02-13 18:21:45 +01:00
Carlos Martín Nieto
22ab293910 Basic reflog support
For now it simply includes reading in the reflog as a list of
entries. This does mean that the drop/append functions don't need to be
wrapped, as we can use erlang's list handling.

It however also means that we cannot write this back out, as there is
currently no way to create an empty reflog that we can fill with our own
list.
2014-02-13 17:41:11 +01:00
Carlos Martín Nieto
9501ed2377 Add reference has_log() 2014-02-13 14:53:19 +01:00
Carlos Martín Nieto
167666cd23 Listen to dialyzer 2013-11-30 20:43:19 +01:00
Carlos Martín Nieto
3110f37ff7 Wrap commit creation 2013-11-24 16:23:01 +01:00
Carlos Martín Nieto
179f424bb5 index: grab all of the fields from C-land 2013-10-16 14:23:38 +02:00
Carlos Martín Nieto
c511675d59 Merge branch 'revparse' 2013-10-16 13:58:20 +02:00
Carlos Martín Nieto
05e1781356 More sensible signature functions
Remove all of the older functions. Bind git_signature_default() and
implement the _now() equivalent in erlang.
2013-10-15 22:31:13 +02:00
Carlos Martín Nieto
21464aeece Wrap git_revparse_single 2013-09-05 15:37:01 +02:00
Carlos Martín Nieto
ee1d719ef4 Remove some dead code 2013-09-03 20:42:28 +02: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
5ada4fe0c1 Warp geef_index in elixir 2013-09-01 20:26:11 +02:00
Carlos Martín Nieto
15ba2dd65f Add support for index_entry's size field 2013-09-01 19:56:35 +02:00
Carlos Martín Nieto
e39a17fe43 Allow retrieval of index entries
This is still very basic, as we only actually load three fields into
the record.
2013-09-01 15:30:15 +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
3a7d37bec8 Fix some dialyzer issues 2013-08-09 23:30:22 +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
52a6f72fef Provide geef_tree:count/1 2013-07-24 23:55:54 +02:00
Carlos Martín Nieto
bf2a59dbf2 Fix some dialyzer warnings 2013-07-17 10:37:00 +02:00
Eric des Courtis
8e9a64af9a Older versions of Erlang (R15B02) don't have erlang:binary_to_integer/2 2013-06-18 16:18:55 -04:00
Carlos Martín Nieto
328b2c4b4b Allow getting a tree entry by position 2013-06-12 02:34:53 +02:00
Carlos Martín Nieto
9d222df593 Initial signature test 2013-06-11 16:34:02 +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
a0ded06b7a Create a record for tree entries 2013-06-06 14:08:53 +02:00
Carlos Martín Nieto
267353ea21 Wrap the rest of the object modules in elixir 2013-06-06 11:14:57 +02:00
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
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
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