Commit Graph

85 Commits

Author SHA1 Message Date
Carlos Martín Nieto
28e890ca95 Adjust to libgit2 v0.23 2015-09-20 20:16:16 +02:00
Ramon Snir
79f89bcd41 add Geef.Revwalk module for Elixir 2015-07-31 21:49:52 +02:00
Ramon Snir
f943274ad8 bug fix to commit create (when parents are given) 2015-07-31 21:49:51 +02:00
Carlos Martín Nieto
4b889ed3bb Fix looking up a commit's tree
We were generating the term from the wrong object, meaning the system
was not keeping the object we should be. We were also not setting the
repository or increasing its refcount, meaning bad news when it came
time to GC the object.
2015-04-24 15:38:00 +02:00
Ramon Snir
906b58a2c8 Update to support libgit2 0.22 2015-04-24 15:33:36 +02:00
Carlos Martín Nieto
ad9acd2356 Allow retrieval of a commit message 2014-12-29 10:11:39 +00: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
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
fcec57c84f Fix alloc_binary param order 2014-02-15 19:28:49 +01:00
Carlos Martín Nieto
378c04284a Remove left-over debugging code 2014-02-14 00:07:43 +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
d9822de604 Extract string->binary conversion 2014-02-13 16:36:10 +01:00
Carlos Martín Nieto
d4204b4b79 Extract signature conversion code 2014-02-13 16:32:46 +01:00
Carlos Martín Nieto
9501ed2377 Add reference has_log() 2014-02-13 14:53:19 +01:00
Carlos Martín Nieto
42d0aef29d Adjust to git_buf and oid->id changes 2014-02-13 14:51:24 +01:00
Carlos Martín Nieto
bb726f90a0 Adjust to reference signature changes
For now we don't use anything significant for the reflog.
2014-02-13 10:50:40 +01:00
Carlos Martín Nieto
adadabdc26 Make sure to set flags to 0 on no option 2014-02-13 02:20:04 +01:00
Carlos Martín Nieto
3110f37ff7 Wrap commit creation 2013-11-24 16:23:01 +01:00
Carlos Martín Nieto
6c272e2c30 index: write out all fields to disc
There is still now way to access what the flags mean, and the times
need to be in pure timestamp form, rather than erlang's.

Non-essential fields are allowed to be 'undefined' and then the
entry's field will remain zeroed.
2013-10-16 15:01:16 +02: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
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
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
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
bb35fce5cc Implement ref iterators 2013-08-09 23:25:55 +02:00
Carlos Martín Nieto
52a6f72fef Provide geef_tree:count/1 2013-07-24 23:55:54 +02: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
042156d843 Bind ref name dwim 2013-06-07 17:55:16 +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
9f500e3fa0 Release binaries after creating writable copy 2013-06-04 23:37:03 +02:00
Carlos Martín Nieto
0e644be825 Add tag-peeling support 2013-05-30 03:39:51 +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
604388a76d Keep the reference name as part of the record 2013-05-13 11:46:12 +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
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
0127730f6b Add geef_index:read_tree() 2013-04-26 14:34:15 +02:00