123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221moduletypeS=sigmoduleHash:S.HASHmoduleInflate:S.INFLATEmoduleDeflate:S.DEFLATEmoduleValue:Value.SwithmoduleHash:=HashandmoduleInflate:=InflateandmoduleDeflate:=DeflateandmoduleBlob=Blob.Make(Hash)andmoduleCommit=Commit.Make(Hash)andmoduleTree=Tree.Make(Hash)andmoduleTag=Tag.Make(Hash)andtypet=Value.Make(Hash)(Inflate)(Deflate).tmoduleReference:Reference.SwithmoduleHash:=Hash(** The type of the git repository. *)typet(** The type error. *)typeerror=private[>`Not_found]valpp_error:errorFmt.t(** Pretty-printer of {!error}. *)(** The type for buffers. *)typebuffervaldefault_buffer:unit->buffer(** The default buffer. *)valbuffer:?ztmp:Cstruct.t->?etmp:Cstruct.t->?dtmp:Cstruct.t->?raw:Cstruct.t->?window:Inflate.window->unit->buffervaldotgit:t->Fpath.t(** [dotgit state] returns the current [".git"] path used - eg. the default
[?dotgit] value of {!create} 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 {!create} if the client does not notice a specific
value. *)valcompression:t->int(** [compression state] returns the current level of the compression used to
write a Git object - eg. the default value [?compression] value of
{!create} if the client does not notice a specific value. *)valcontents:t->((Hash.t*Value.t)list,error)resultLwt.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.t->(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.t->(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_exn:t->Hash.t->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.t->boolLwt.t(** [mem state hash] checks if one object satisfies the predicate
[digest(object) = hash]. *)vallist:t->Hash.tlistLwt.t(** [list state] lists all git objects available in the current git
repository [state]. *)valwrite:t->Value.t->(Hash.t*int,error)resultLwt.t(** [write state v] writes the value [v] in the git repository [state]. *)valfold:t->('acc->?name:Path.t->length:int64->Hash.t->Value.t->'accLwt.t)->path:Path.t->'acc->Hash.t->'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
objects, 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:
{ul
{- {!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 follozs recursively all
parents of the current commit, Finallym it starts a [fold] inside the
pointed root {i tree} git object of each {i commit} previously retrieved.
[f] 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.t->Value.t->unitLwt.t)->Hash.t->unitLwt.tmodulePack:sig(** The stream contains the PACK flow. *)typestream=unit->Cstruct.toptionLwt.tvalfrom:t->stream->(Hash.t*int,error)resultLwt.t(** [from git stream] populates the Git repository [git] from the PACK flow
[stream]. If any error is encountered, any Git objects of the PACK flow
are not added in the Git repository. *)valmake:t->?window:[`Objectofint|`Memoryofint]->?depth:int->Value.tlist->(stream*(Checkseum.Crc32.t*int64)Hash.Map.tLwt_mvar.t,error)resultLwt.t(** [make ?window ?depth values] makes a PACK stream from a list of
{!Value.t}.
[?window] specifies the weight of the window while the delta-ification.
The client can limit the weight by the number of objects in the windoz
(by default, is 10) or by the weight in byte of the window in your
memory.
[depth] (default is [50]) limits the depth of the delta-ification.
Then, the function returns a stream and a protected variable which
contains a representation of the associated IDX file of the PACK
stream. This protected variable is available ([Lwt_mvar.take]) only {b
at the end} of the PACK stream. That means, the client needs to consume
all of the stream and only then he can take the [Graph.t] associated. *)endmoduleRef:sigvallist:t->(Reference.t*Hash.t)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.head_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.t,error)resultLwt.t(** [resolve state reference] returns endpoint of [reference] (available in
the git repository [state]). *)valwrite:t->Reference.t->Reference.head_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. *)valclear_caches:t->unitLwt.t(** [clear_caches t] drops all values stored in the internal caches binded
with the git repository [t]. *)valread_inflated:t->Hash.t->([`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->Hash.tLwt.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. *)(** {1 Backend Features} *)valhas_global_watches:boolvalhas_global_checkout:boolend