package git

  1. Overview
  2. Docs

Packed values.

Packed values

type copy = {
  1. copy_offset : int;
  2. copy_length : int;
}

The type for Copy's hunk arguments.

type hunk =
  1. | Insert of string
  2. | Copy of copy
    (*

    The type for delta hunks. A delta hunk can either insert a string of copy the contents of a base object.

    *)
type 'a delta = {
  1. source : 'a;
  2. source_length : int;
  3. result_length : int;
  4. hunks : hunk list;
}

The type for delta values.

type kind =
  1. | Raw_value of string
  2. | Ref_delta of Hash.t delta
  3. | Off_delta of int delta
    (*

    The type for packed values kind.

    *)
type t = {
  1. kind : kind;
  2. offset : int;
}

The type for packed values.

val shallow : Hash.Set.t -> t -> bool

shallow p t checks whether the Hashs appearing in t also appear in the pack file p.

val create : offset:int -> kind:kind -> t

Create a packed value.

val kind : t -> kind

kind t is t's kind.

val offset : t -> int

offset t is t's offset.

val pp_kind : Format.formatter -> kind -> unit

Pretty-print packed values' kind.

val is_delta : t -> bool

Check if a packed value is a delta (either a Ref_delta or an Off_delta).

val result_length : t -> int

Return the lenght of the result object.

val source_length : t -> int

Return the lenght of the base (source) object.

include S with type t := t
val equal : t -> t -> bool

Are two objects equal?

val hash : t -> int

Hash an object.

val compare : t -> t -> int

Compare two objects.

val pp : t Fmt.t

pp is the pretty-printer for values of type t.

Positition-independant packed values

module PIC : sig ... end
type pic = PIC.t

The type for position-independant packked values.

module IO (D : Hash.DIGEST) (I : Inflate.S) : sig ... end