package git-unix
Library
Module
Module type
Parameter
Class
Class type
include Git.Hash.H with type t = Git.Hash.t
include Git.Hash.S with type t = Git.Hash.t
Signature for hash values
The usual compare functions on hashes, but can raise Ambiguous
if one is short hash and is prefix to the other.
include Git.S with type t = Git.Hash.t
type t = Git.Hash.t
The type for the given Git object.
val to_raw : t -> string
Raw hash value.
val of_raw : string -> t
Abstract a raw hash value.
val to_hex : t -> string
to_hex h
is h
s' hex encoding.
val hex_length : t -> int
The number of hex digits in the hash.
include Git.IO with type t := t
Input/output functions
Add the serialization of the value to an already existing buffer.
The compression level
must be between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). The default value (currently equivalent to level 6) requests a default compromise between speed and compression.
val of_hex : string -> t
Convert an hex-encoded string into a hash value. Raise Ambiguous
if the hash is short; in that case use of_short_hex
.
val of_short_hex : string -> t
Same as of_hex
but allow values shorter than 20 characters. Such hash values are called short hashes and can cause some functions to raise Ambiguous
.
val is_short : t -> bool
Check if the hash is short.
val zero : t
A hash full of zero. Useful for padding.
module Blob : Git.Hash.H with type t = Git.Hash.Blob.t
module Tree : Git.Hash.H with type t = Git.Hash.Tree.t
module Commit : Git.Hash.H with type t = Git.Hash.Commit.t