package irmin
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=964512f77697947a73dd1875c634d6804e98f14167c5aadd3c4f85b5f30ffb53
sha512=d56d3285daa2dd36f1eaff867af5c8f44c61bba4de1a5c7bb5347652dbc460c343483ab61de1a9302f664af357eacc964dc5c8b4477f6d01372dc028b162e98b
doc/irmin.mem/Irmin_mem/KV/Make/Head/index.html
Module Make.Head
Source
Managing the store's heads.
list t
is the list of all the heads in local store. Similar to git rev-list --all
.
find t
is the current head of the store t
. This works for both persistent and temporary branches. In the case of a persistent branch, this involves getting the the head associated with the branch, so this may block. In the case of a temporary store, it simply returns the current head. Returns None
if the store has no contents. Similar to git rev-parse HEAD
.
Same as find
but raise Invalid_argument
if the store does not have any contents.
set t h
updates t
's contents with the contents of the commit h
. Can cause data loss as it discards the current contents. Similar to git reset --hard <hash>
.
fast_forward t h
is similar to set
but the t
's head is updated to h
only if h
is stricly in the future of t
's current head. max_depth
or n
are used to limit the search space of the lowest common ancestors (see lcas
).
The result is:
Ok ()
if the operation is succesfull;Error `No_change
ifh
is alreadyt
's head;Error `Rejected
ifh
is not in the strict future oft
's head.Error e
if the history exploration has been cut before getting useful results. In that case. the operation can be retried using different parameters ofn
andmax_depth
to get better results.
val merge :
into:t ->
info:Info.f ->
?max_depth:int ->
?n:int ->
commit ->
(unit, Irmin.Merge.conflict) result Lwt.t
merge ~into:t ?max_head ?n commit
merges the contents of the commit associated to commit
into t
. max_depth
is the maximal depth used for getting the lowest common ancestor. n
is the maximum number of lowest common ancestors. If present, max_depth
or n
are used to limit the search space of the lowest common ancestors (see lcas
).