package git

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module FS : sig ... end
module Hash : sig ... end
module Deflate : sig ... end
module Inflate : sig ... end
module Value : Value.S with module Hash := Hash and module Deflate := Deflate and module Inflate := Inflate
include module type of Value
module Blob : Blob.S with module Hash := Hash
module Commit : Commit.S with module Hash := Hash
module Tree : Tree.S with module Hash := Hash
module Tag : Tag.S with module Hash := Hash
type t =
  1. | Blob of Blob.t
    (*

    The Blob.t OCaml value.

    *)
  2. | Commit of Commit.t
    (*

    The Commit.t OCaml value.

    *)
  3. | Tree of Tree.t
    (*

    The Tree.t OCaml value.

    *)
  4. | Tag of Tag.t
    (*

    The Tag.t OCaml value.

    *)

OCaml value which represents a Git object.

val blob : Blob.t -> t
val commit : Commit.t -> t
val tree : Tree.t -> t
val tag : Tag.t -> t
val kind : t -> [ `Commit | `Blob | `Tree | `Tag ]

kind o returns the kind of the Git object.

val pp_kind : [ `Commit | `Blob | `Tree | `Tag ] Fmt.t

pp_kind ppf kind is a human readable pretty-printer of kind.

module MakeMeta (Meta : Encore.Meta.S) : sig ... end
module A : sig ... end
module M : sig ... end
module D : sig ... end
module E : sig ... end
val digest : t -> Hash.t
val pp : t Fmt.t
val compare : t -> t -> int
val hash : t -> int
val equal : t -> t -> bool
module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
val length : t -> int64
type kind = [
  1. | `Commit
  2. | `Tree
  3. | `Tag
  4. | `Blob
]
val pp_error : error Fmt.t
val mem : fs:FS.t -> root:Fpath.t -> Hash.t -> bool Lwt.t
val read : fs:FS.t -> root:Fpath.t -> window:Inflate.window -> ztmp:Cstruct.t -> dtmp:Cstruct.t -> raw:Cstruct.t -> Hash.t -> (t, error) Stdlib.result Lwt.t

read ~fs ~root ~window ~ztmp ~dtmp ~raw hash tries to extract from a loose file localized in root / objects a Git object. This function reads (uses raw buffer to read) the file, inflates (uses ztmp and window to inflate) and decodes (uses dtmp to decode) Git object and make a Value.t.

val read_inflated : fs:FS.t -> root:Fpath.t -> window:Inflate.window -> ztmp:Cstruct.t -> dtmp:Cstruct.t -> raw:Cstruct.t -> Hash.t -> (kind * Cstruct.t, error) Stdlib.result Lwt.t

read_inflated ~fs ~root ~window ~ztmp ~dtmp ~raw hash tries to extract from a loose file localized in root / objects a Git object. This function reads (uses raw buffer to read) the file, inflates (uses ztmp and window to inflate) and decodes only Git header and body (uses dtmp to decode) Git object and make a fresh buffer.

Body is the serialization of the Git object, and, from kind (kind of Git object), client can call decoder associated to the kind returned (like Tree.Decoder for example).

val read_inflated_without_allocation : fs:FS.t -> root:Fpath.t -> window:Inflate.window -> ztmp:Cstruct.t -> dtmp:Cstruct.t -> raw:Cstruct.t -> result:Cstruct.t -> Hash.t -> (kind * Cstruct.t, error) Stdlib.result Lwt.t

read_inflated_without_allocation ~fs ~root ~window ~ztmp ~dtmp ~raw ~result hash is the same as read_inflated. However, instead to make a fresh buffer which will contain the Git object serialized, it uses result to store it. This function does not allocate any buffer.

val list : fs:FS.t -> root:Fpath.t -> Hash.t list Lwt.t
val size : fs:FS.t -> root:Fpath.t -> window:Inflate.window -> ztmp:Cstruct.t -> dtmp:Cstruct.t -> raw:Cstruct.t -> Hash.t -> (int64, error) Stdlib.result Lwt.t
val write : fs:FS.t -> root:Fpath.t -> temp_dir:Fpath.t -> ?capacity:int -> ?level:int -> ztmp:Cstruct.t -> raw:Cstruct.t -> t -> (Hash.t * int, error) Stdlib.result Lwt.t
val write_deflated : fs:FS.t -> root:Fpath.t -> temp_dir:Fpath.t -> ?level:int -> raw:Cstruct.t -> kind:kind -> Cstruct.t -> (Hash.t, error) Stdlib.result Lwt.t
OCaml

Innovation. Community. Security.