Something went wrong. Try again.
A local Git merge queue with content-bound gate verdicts
Something went wrong. Try again.
1.3 kB · 36 lines
OCaml
at main
12345678910111213141516171819202122232425262728293031323334353637(** Commit ids.
A commit id is the object id of a commit (gitglossary(7), "commit object"). It is a private {!Git.Hash.t}: it coerces to a hash wherever the Git library takes one, and a tree id ({!Tree.t}) is never taken for one. A branch holds a commit; the refs mq keeps under [refs/mq/] hold records, tags that point at commits ({!Record}). *)
type t = private Git.Hash.t(** The type for commit ids. *)
val of_hash : Git.Hash.t -> t(** [of_hash h] is [h] as a commit id. The caller read [h] where Git keeps a commit: a ref, a commit's parent, a commit it wrote. *)
val of_hex : string -> t option(** [of_hex s] is the commit id written [s] in hexadecimal, or [None] if [s] is not a hexadecimal object id. *)
val to_hex : t -> string(** [to_hex c] is [c] in lowercase hexadecimal. *)
val short : t -> string(** [short c] is the first twelve digits of [to_hex c], the form mq prints. *)
val equal : t -> t -> bool(** [equal c0 c1] is [true] iff [c0] and [c1] are the same commit. *)
val compare : t -> t -> int(** [compare] is a total order on commit ids, compatible with {!equal}. *)
val pp : t Fmt.t(** [pp] formats a commit id as {!to_hex}. *)
val codec : t Json.Codec.t(** [codec] is a commit id as a JSON string, {!to_hex}, read with {!of_hex}. *)