package irmin

  1. Overview
  2. No Docs
Irmin, a distributed database that follows the same design principles as Git

Install

Dune Dependency

Authors

Maintainers

Sources

irmin-3.9.0.tbz
sha256=8e073abe1b5ffb5b6d58c32606c9d7dabc32c53501756be80a92ed4777ad51a0
sha512=70769a8d36520626fecd6f68e5f3abe6a0d67a65af915312206cc3f4da230df48512faee178aa6e899d3fb640b9340f6c92486185be5432a1a1a161c70386c99

doc/irmin.mem/Irmin_mem/Make/Head/index.html

Module Make.HeadSource

Managing the store's heads.

Sourceval list : repo -> commit list Lwt.t

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

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

Sourceval get : t -> commit Lwt.t

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

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

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

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