From 3de16f3b07a3e107ad7030cdd38907458103b496 Mon Sep 17 00:00:00 2001 From: ArthurW Date: Mon, 2 Sep 2024 16:51:14 +0200 Subject: [PATCH 1/2] irmin-git: expose Content_addressable type --- CHANGES.md | 5 +++++ src/irmin-git/irmin_git.ml | 7 ++++--- src/irmin-git/irmin_git_intf.ml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3a08bbb66c..ffa53a7bf1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,10 @@ ## Unreleased +### Added + +- **irmin-git** + - Expose `Content_addressable` type (#2329, @art-w) + ### Fixed - **irmin-client** diff --git a/src/irmin-git/irmin_git.ml b/src/irmin-git/irmin_git.ml index d62b30b994..806ac77766 100644 --- a/src/irmin-git/irmin_git.ml +++ b/src/irmin-git/irmin_git.ml @@ -110,7 +110,7 @@ module Content_addressable (G : Git.S) = struct let v ?dotgit:_ _root = assert false end - module type S = Irmin.Content_addressable.S with type key = G.Hash.t + module type S = Irmin.Content_addressable.S with type _ t = G.t and type key = G.Hash.t module Maker = Maker_ext (G) (No_sync) @@ -125,11 +125,12 @@ module Content_addressable (G : Git.S) = struct module M = Maker.Make (Schema) module X = M.Backend.Contents + type 'a t = G.t + let state t = - let+ r = M.repo_of_git (snd t) in + let+ r = M.repo_of_git t in M.Backend.Repo.contents_t r - type 'a t = bool ref * G.t type key = X.key type value = X.value diff --git a/src/irmin-git/irmin_git_intf.ml b/src/irmin-git/irmin_git_intf.ml index f6e57f4841..4ad5a5f812 100644 --- a/src/irmin-git/irmin_git_intf.ml +++ b/src/irmin-git/irmin_git_intf.ml @@ -116,7 +116,7 @@ module type Sigs = sig (** Use Git as a content-addressable store. Values will be stored into [.git/objects].*) - module type S = Irmin.Content_addressable.S with type key = G.Hash.t + module type S = Irmin.Content_addressable.S with type _ t = G.t and type key = G.Hash.t module Make (V : Irmin.Type.S) : S with type value = V.t end From f1c8dc78070ac73ec7ebcbdc2c9e8c10f974ed9a Mon Sep 17 00:00:00 2001 From: ArthurW Date: Mon, 9 Sep 2024 09:44:10 +0200 Subject: [PATCH 2/2] Update ocamlformat to 0.26.2 --- .ocamlformat | 2 +- src/irmin-git/irmin_git.ml | 3 ++- src/irmin-git/irmin_git_intf.ml | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.ocamlformat b/.ocamlformat index b405018f05..1e05915f71 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -1,4 +1,4 @@ -version = 0.26.0 +version = 0.26.2 profile = conventional ocaml-version = 4.08.0 diff --git a/src/irmin-git/irmin_git.ml b/src/irmin-git/irmin_git.ml index 806ac77766..fdcc49736c 100644 --- a/src/irmin-git/irmin_git.ml +++ b/src/irmin-git/irmin_git.ml @@ -110,7 +110,8 @@ module Content_addressable (G : Git.S) = struct let v ?dotgit:_ _root = assert false end - module type S = Irmin.Content_addressable.S with type _ t = G.t and type key = G.Hash.t + module type S = + Irmin.Content_addressable.S with type _ t = G.t and type key = G.Hash.t module Maker = Maker_ext (G) (No_sync) diff --git a/src/irmin-git/irmin_git_intf.ml b/src/irmin-git/irmin_git_intf.ml index 4ad5a5f812..7e8fecee3d 100644 --- a/src/irmin-git/irmin_git_intf.ml +++ b/src/irmin-git/irmin_git_intf.ml @@ -116,7 +116,8 @@ module type Sigs = sig (** Use Git as a content-addressable store. Values will be stored into [.git/objects].*) - module type S = Irmin.Content_addressable.S with type _ t = G.t and type key = G.Hash.t + module type S = + Irmin.Content_addressable.S with type _ t = G.t and type key = G.Hash.t module Make (V : Irmin.Type.S) : S with type value = V.t end