package irmin-git

  1. Overview
  2. Docs
Git backend for Irmin

Install

Dune Dependency

Authors

Maintainers

Sources

irmin-3.11.0.tbz
sha256=09996fbcc2c43e117a9bd8e9028c635e81cccb264d5e02d425ab8b06bbacdbdb
sha512=0391a6bf7b94a1edd50a3a8df9e58961739fa78d7d689d61f56bc87144483bad2ee539df595c33d9d52c29b3458da5dddf3a73b5eb85e49c4667c26d2cd46be1

doc/irmin-git.unix/Irmin_git_unix/Maker/KV/Head/index.html

Module KV.Head

Managing the store's heads.

val list : repo -> commit list Lwt.t

list t is the list of all the heads in local store. Similar to git rev-list --all.

val find : t -> commit option Lwt.t

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.

val get : t -> commit Lwt.t

Same as find but raise Invalid_argument if the store does not have any contents.

val set : t -> commit -> unit Lwt.t

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>.

val fast_forward : t -> ?max_depth:int -> ?n:int -> commit -> (unit, ff_error) result Lwt.t

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 if h is already t's head;
  • Error `Rejected if h is not in the strict future of t'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 of n and max_depth to get better results.
val test_and_set : t -> test:commit option -> set:commit option -> bool Lwt.t

Same as set but check that the value is test before updating to set. Use set or merge instead if possible.

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).

OCaml

Innovation. Community. Security.