Persistent store with Git semantics: lazy reads, delayed writes, content-addressing
at main 24 lines 684 B view raw
1(** Commit operations delegating to Codec. *) 2 3module Make (F : Codec.S) = struct 4 type hash = F.hash 5 type t = F.commit 6 7 let tree = F.commit_tree 8 let parents = F.commit_parents 9 let author = F.commit_author 10 let committer = F.commit_committer 11 let message = F.commit_message 12 let timestamp = F.commit_timestamp 13 14 let v ~tree ~parents ~author ?(committer = author) 15 ?(timestamp = Int64.of_float (Unix.gettimeofday ())) ~message () = 16 F.commit_make ~tree ~parents ~author ~committer ~message ~timestamp 17 18 let to_bytes = F.commit_to_bytes 19 let of_bytes = F.commit_of_bytes 20 let hash = F.commit_hash 21end 22 23module Git = Make (Codec.Git) 24module Mst = Make (Codec.Mst)