Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to git-kv.0.1.2 and workaround git-kv bug #62

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### Next

- Update to git-kv 1.0.2 and work around last modified behavior inside a `Git_kv.change_and_push` call (by [reynir](https://reyn.ir))


### v2.1.0 2024-12-14 Nantes (France)

- Support for OCaml `5.3.0` (by [kit-ty-kate](https://github.com/kit-ty-kate))
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
(lwt (>= 5.7.0))
(mimic (>= 0.0.9))
(cstruct (>= 6.2.0))
(git-kv (>= 0.0.5))
(git-kv (>= 0.1.2))
(git-unix (>= 3.16.1))
(mirage-clock (>= 4.2.0))
(yocaml (= :version))
Expand Down
13 changes: 13 additions & 0 deletions plugins/yocaml_git/yocaml_git.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ let run (module Source : Required.SOURCE) (module Clock : Mirage_clock.PCLOCK)
let* context = match context with `SSH -> Ssh.context () in
let* store = Git_kv.connect context remote in
let module Store = Git_kv.Make (Clock) in
let module Store = struct
include Store
(* last_modified and change_and_push have a weird interaction;
so we show the old last_modified *)
let last_modified new_store key =
let* r = last_modified store key in
match r with
| Error `Not_found _ ->
last_modified new_store key
| _ ->
Lwt.return r
end
in
Store.change_and_push ?author ?author_email:email ?message store (fun store ->
let module Config = struct
let store = store
Expand Down
2 changes: 1 addition & 1 deletion yocaml_git.opam
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ depends: [
"lwt" {>= "5.7.0"}
"mimic" {>= "0.0.9"}
"cstruct" {>= "6.2.0"}
"git-kv" {>= "0.0.5"}
"git-kv" {>= "0.1.2"}
"git-unix" {>= "3.16.1"}
"mirage-clock" {>= "4.2.0"}
"yocaml" {= version}
Expand Down
Loading