package git

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Parameters

module H : sig ... end
module FS : sig ... end
module I : sig ... end
module D : sig ... end

Signature

module FS = FS
module Value : Value.S with module Hash := H and module Deflate := D and module Inflate := I
include module type of Value with module Blob = Blob.Make(H) with module Commit = Commit.Make(H) with module Tree = Tree.Make(H) with module Tag = Tag.Make(H) with type t = Value.Make(H)(I)(D).t
module Blob = Blob.Make(H)
module Commit = Commit.Make(H)
module Tree = Tree.Make(H)
module Tag = Tag.Make(H)
type t = Value.Make(H)(I)(D).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 -> H.t
val pp : t Fmt.t
val compare : t -> t -> int
val hash : t -> int
val equal : t -> t -> bool
module Set : Set.S with type elt = t
module Map : 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 -> H.t -> bool Lwt.t
val read : fs:FS.t -> root:Fpath.t -> window:I.window -> ztmp:Cstruct.t -> dtmp:Cstruct.t -> raw:Cstruct.t -> H.t -> (t, error) 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:I.window -> ztmp:Cstruct.t -> dtmp:Cstruct.t -> raw:Cstruct.t -> H.t -> (kind * Cstruct.t, error) 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:I.window -> ztmp:Cstruct.t -> dtmp:Cstruct.t -> raw:Cstruct.t -> result:Cstruct.t -> H.t -> (kind * Cstruct.t, error) 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 -> H.t list Lwt.t
val size : fs:FS.t -> root:Fpath.t -> window:I.window -> ztmp:Cstruct.t -> dtmp:Cstruct.t -> raw:Cstruct.t -> H.t -> (int64, error) result Lwt.t
val write : fs:FS.t -> root:Fpath.t -> temp_dir:Fpath.t -> etmp:Cstruct.t -> ?level:int -> ztmp:Cstruct.t -> raw:Cstruct.t -> t -> (H.t * int, error) 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 -> (H.t, error) result Lwt.t
OCaml

Innovation. Community. Security.