package git-unix

  1. Overview
  2. Docs

Module Value.CommitSource

Sourcetype hash = hash
Sourcetype nonrec t = hash Git.Commit.t
Sourceval make : tree:hash -> author:Git.User.t -> committer:Git.User.t -> ?parents:hash list -> ?extra:(string * string list) list -> string option -> t

make ~author ~committer ?parents ~tree msg makes an OCaml value t. ?parents should be a non-empty list and corresponds to a list of hashes of parent commits. tree should be a hash of a Tree.t object.

Note. This function does not write a new commit on the store and does not check the validity of parents and tree. By this way, this function never fails.

Sourceval format : t Encore.t

format is a description of how to encode/decode of t object.

Sourceval digest : t -> hash

digest t associates a hash to any value of t. It is guaranteed that if x = y or compare x y = 0, then digest x = digest y.

Sourceval pp : t Fmt.t

Pretty-printer of t.

Sourceval compare : t -> t -> int

The comparison function for t.

Sourceval hash : t -> int

hash blob associates a non-negative integer to any value of t. It is guaranteed that if x = y or compare x y = 0, then hash x = hash y.

Sourceval equal : t -> t -> bool

The equal function for t.

Sets and Maps.

Sourcemodule Set : Set.S with type elt = t
Sourcemodule Map : Map.S with type key = t
Sourceval length : t -> int64

length t returns the length of the given commit object.

Sourceval parents : t -> hash list

parents t returns all parents of the given commit object.

Sourceval tree : t -> hash

tree t returns the hash of top-level Tree.t of the given commit object.

Sourceval committer : t -> Git.User.t

committer t returns the committer of the given commit object.

Sourceval author : t -> Git.User.t

author c returns the author of the given commit object.

Sourceval message : t -> string option

message c returns the message of the given commit object.

Sourceval extra : t -> (string * string list) list
Sourceval compare_by_date : t -> t -> int

compare_by_date a b compares commit objects a and b by the date of the author. The compare function as the same behaviour.

OCaml

Innovation. Community. Security.