123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169moduletypeS=sigtypettypehashtypedecode_error:=[`Msgofstring]typeerror=private[>`Not_foundofhash|`Reference_not_foundofReference.t|decode_error]valpp_error:errorFmt.tmoduleHash:S.HASHwithtypet=hashmoduleValue:Value.Swithtypehash=hashmoduleReference:Reference.Swithtypehash=hashvaldotgit:t->Fpath.t(** [dotgit state] returns the current [".git"] path used - eg. the default
[?dotgit] value of [v] if the client does not notice a specific
value. *)valroot:t->Fpath.t(** [root state] returns the current path of the repository. eg. the default
value [?root] value of [v] if the client does not notice a specific
value. *)(*
val compression : t -> int
(** [compression state] returns the current level of the compression used to
write a Git object - eg. the default value [?compression] value of
[v] if the client does not notice a specific value. *)
*)valcontents:t->(hash*Value.t)listLwt.t(** [contents state] returns an associated list between the hash and its bind
git object. This list contains all git objects available in the current
git repository [state]. *)valsize:t->hash->(int64,error)resultLwt.t(** [size state hash] returns the size of the git object which respects the
predicate [digest(object) = hash]. The size is how many byte(s) are needed
to store the serialized (but not deflated) git object in bytes (without
the header). *)valread:t->hash->(Value.t,error)resultLwt.t(** [read state hash] can retrieve a git object from the current repository
[state]. It de-serializes the git object to an OCaml value. *)valread_opt:t->hash->(Value.toption,decode_error)resultLwt.t(** [read_opt state hash] is like {!read} but does not return (or log) an
error if the git object referenced by [hash] cannot be retrieved from
[state]. *)valread_exn:t->hash->Value.tLwt.t(** [read_exn state hash] is an alias of {!read} but raise an exception
(instead to return a [result]) if the git object requested does not exist
or when we catch any others errors. *)valmem:t->hash->boolLwt.t(** [mem state hash] checks if one object satisfies the predicate
[digest(object) = hash]. *)vallist:t->hashlistLwt.t(** [list state] lists all git objects available in the current git repository
[state]. *)valwrite:t->Value.t->(hash*int,error)resultLwt.t(** [write state v] writes the value [v] in the git repository [state]. *)valbatch_write:t->hash->pck:(unit->stringoptionLwt.t)->idx:(unit->stringoptionLwt.t)->(unit,error)resultLwt.t(** [batch_write state map pack index] writes all objects {i indexed} into
[index] and available into [pack] in the git repository [state]. *)valfold:t->('acc->?name:Fpath.t->length:int64->hash->Value.t->'accLwt.t)->path:Fpath.t->'acc->hash->'accLwt.t(** [fold state f ~path acc hash] iters on any git objects reachable by the
git object [hash] which located in [path] (for example, if you iter on a
commit, [path] should be ["."] - however, if you iter on a tree, [path]
should be the directory path represented by your tree). For each git
object, we notice the path [name] (derived from [path]) if the object is
a Blob or a Tree, the [length] or the git object (see {!size}), the [hash]
and the [value].
If the [hash] points to:
- {!Value.Blob.t}: [f] is called only one time with the OCaml value of the
{i blob}.
- {!Value.Tree.t}: [f] is called firstly with the OCaml value of the
pointed {i tree} by the hash [hash]. Then, we {i iter} (and call [f] for
each iteration) in the list of entries of the {i tree}. Finally, we
retrieve recursively all sub-tree objects and do an ascending walk. [f]
is never called more than one time for each hash.
- {!Value.Commit.t}: [f] is called firstly with the OCaml value of the
pointed {i commit} by the hash [hash]. Then, it follows recursively all
parents of the current commit, Finally, it starts a [fold] inside the
pointed root {i tree} git object of each {i commit} previously
retrieved. [f] is never called more than one time for each hash.
- {!Value.Tag.t}: [f] is called firstly with the OCaml value of the
pointed {i tag} by the hash [hash]. Then, it follows the git object
pointed by the {i tag}.
Any retrieved {!error} is missed. *)valiter:t->(hash->Value.t->unitLwt.t)->hash->unitLwt.tmoduleRef:sigvallist:t->(Reference.t*hash)listLwt.t(** [list state] returns an associated list between reference and its bind
hash. *)valmem:t->Reference.t->boolLwt.t(** [mem state ref] returns [true] iff [ref] exists in [state], otherwise
returns [false]. *)valread:t->Reference.t->(Reference.contents,error)resultLwt.t(** [read state reference] returns the value contains in the reference
[reference] (available in the git repository [state]). *)valresolve:t->Reference.t->(hash,error)resultLwt.t(** [resolve state reference] returns obj-id pointed at by [reference]
(available in the git repository [state]). *)valwrite:t->Reference.t->Reference.contents->(unit,error)resultLwt.t(** [write state reference value] writes the value [value] in the mutable
representation of the [reference] in the git repository [state]. *)valremove:t->Reference.t->(unit,error)resultLwt.t(** [remove state reference] removes the reference [reference] from the git
repository [state]. *)endvalreset:t->(unit,error)resultLwt.t(** [reset t] removes all things of the git repository [t] and ensures it will
be empty. *)valread_inflated:t->hash->([`Commit|`Tag|`Blob|`Tree]*Cstruct.t)optionLwt.t(** [read_inflated state hash] returns the inflated git object which respect
the predicate [digest(value) = hash]. We return the kind of the object and
the inflated value as a {!Cstruct.t} (which the client can take the
ownership). *)valwrite_inflated:t->kind:[`Commit|`Tree|`Blob|`Tag]->Cstruct.t->hashLwt.t(** [write_inflated state kind raw] writes the git object in the git
repository [state] and associates the kind to this object. This function
does not verify if the raw data is well-defined (and respects the Git
format). Then, this function returns the hash produced from the kind and
the inflated raw to let the user to retrieve it. *)valis_shallowed:t->hash->boolLwt.tvalshallowed:t->hashlistLwt.tvalshallow:t->hash->unitLwt.tvalunshallow:t->hash->unitLwt.t(** {1 Backend Features} *)valhas_global_watches:boolvalhas_global_checkout:boolend