package git

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

Interface which describes raw operations. That means all serialization/unserialization to a Cstruct.t.

module Hash : sig ... end
module Inflate : sig ... end
module Deflate : sig ... end
module Value : S with module Hash := Hash and module Inflate := Inflate and module Deflate := Deflate
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
module EncoderRaw : sig ... end
module DecoderRaw : sig ... end
module EncoderWithoutHeader : sig ... end
val to_deflated_raw : raw:Cstruct.t -> etmp:Cstruct.t -> ?level:int -> ztmp:Cstruct.t -> t -> (string, E.error) Stdlib.result

to_deflated_raw ?capacity ?level ~ztmp value serializes and deflates the value value. capacity is the memory consumption of the encoder in bytes (default to 0x100), level is the level of the compression (default to 4) and ztmp is an internal buffer used to store the serialized value before the deflation.

All error from the Deflate module is relayed to the `Deflate error value.

val to_raw : raw:Cstruct.t -> etmp:Cstruct.t -> t -> (string, EncoderRaw.error) Stdlib.result

to_raw ?capacity value serializes the value value. capacity is the memory consumption of the encoder in bytes (default to 0x100).

This function can not returns an EE.error (see EE).

val to_raw_without_header : raw:Cstruct.t -> etmp:Cstruct.t -> t -> (string, EncoderWithoutHeader.error) Stdlib.result
val of_raw : kind:[ `Commit | `Blob | `Tree | `Tag ] -> Cstruct.t -> (t, Error.Decoder.t) Stdlib.result

of_raw ~kind inflated makes a Git object as an OCaml value t. This decoder does not expect an header to recognize which kind of Git object is it. That means the inflated raw should not contain kind size\000 at the beginning (in this case, you should use of_raw_with_header.

val of_raw_with_header : Cstruct.t -> (t, DecoderRaw.error) Stdlib.result

of_raw_with_header inflated makes a Git object as an OCaml value t. This decoder expects an header to choose which Git object it is.

OCaml

Innovation. Community. Security.