From 6c2052d95f884337e389bec73a56d81b33029c84 Mon Sep 17 00:00:00 2001 From: metanivek Date: Mon, 2 Oct 2023 15:17:59 -0400 Subject: [PATCH 1/4] irmin-git: use length to update pos when decoding --- src/irmin-git/contents.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/irmin-git/contents.ml b/src/irmin-git/contents.ml index 62c50b5c9f4..2a0d4522d41 100644 --- a/src/irmin-git/contents.ml +++ b/src/irmin-git/contents.ml @@ -52,9 +52,10 @@ module Make (G : Git.S) (C : Irmin.Contents.S) = struct match Raw.of_raw_with_header ~off buf with | Ok g -> ( match V.of_git g with - | Some g -> - pos_ref := String.length buf; - g + | Some v -> + let len = Raw.length_with_header g |> Int64.to_int in + pos_ref := off + len; + v | None -> failwith "wrong object kind") | Error (`Msg _) -> failwith "wrong object" From cee2d13ed697d89b20b0d79ff4b5da218a4c19cd Mon Sep 17 00:00:00 2001 From: metanivek Date: Mon, 2 Oct 2023 15:21:11 -0400 Subject: [PATCH 2/4] irmin-git: move lower bounds for git to 3.14 We are now using a new function, `Raw.length_with_header` --- irmin-git.opam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/irmin-git.opam b/irmin-git.opam index a50451c80ca..1f1ad0569a2 100644 --- a/irmin-git.opam +++ b/irmin-git.opam @@ -19,8 +19,8 @@ depends: [ "dune" {>= "2.9.0"} "irmin" {= version} "ppx_irmin" {= version} - "git" {>= "3.7.0"} - "git-unix" {>= "3.7.0"} + "git" {>= "3.14.0"} + "git-unix" {>= "3.14.0"} "digestif" {>= "0.9.0"} "cstruct" "fmt" From 12a5e4273cd0ea14dac45fb3f7e96fcb9c955b34 Mon Sep 17 00:00:00 2001 From: metanivek Date: Mon, 2 Oct 2023 15:22:08 -0400 Subject: [PATCH 3/4] examples/server: use git in-memory store --- examples/server/config.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/server/config.ml b/examples/server/config.ml index ba209539039..73e6e9051b7 100644 --- a/examples/server/config.ml +++ b/examples/server/config.ml @@ -14,6 +14,11 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *) -module Store = Irmin_mem.KV.Make (Irmin.Contents.String) +module Store = struct + module Git_impl = Irmin_git.Mem + module Sync = Git.Mem.Sync (Git_impl) + module Maker = Irmin_git.KV (Git_impl) (Sync) + include Maker.Make (Irmin.Contents.String) +end let uri = Uri.of_string "tcp://localhost:4242" From 39d14fe79901b2fa6d525cd42c71d33b55d8e0f3 Mon Sep 17 00:00:00 2001 From: metanivek Date: Mon, 2 Oct 2023 15:47:03 -0400 Subject: [PATCH 4/4] Update CHANGES --- CHANGES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index a9b6353c70c..8f8e93d9324 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -26,6 +26,11 @@ the maintenance of that part of the code, as ensuring the correct order of cached IO operations was tricky for stream proofs (#2275, @samoht) +### Changed + +- **irmin-git** + - Moved lower bounds to `git.3.14.0` to use new function (#2277, @metanivek) + ## 3.8.0 (2023-07-06) ### Added