Open kentookura opened 5 months ago
Hello! I don't have access to a windows machine to test, but your example code works out of the box on my linux... Can you confirm if the following also fails without the irmin dependency?
(executable (name test) (libraries lwt git-unix git.nss.git))
open Lwt.Syntax
open Lwt.Infix
module Store = Git_unix.Store
module Sync = Git_unix.Sync (Store)
module Uri = Smart_git.Endpoint
let src =
Uri.of_string "https://git.sr.ht/~jonsterling/public-trees" |> Result.get_ok
let main () =
let* ctx = Git_unix.ctx (Happy_eyeballs_lwt.create ()) in
let* store = Store.v Fpath.(v "/tmp" / "gitsync") >|= Result.get_ok in
let+ result = Sync.fetch ~ctx src store `All in
match result with
| Ok (Some (_hash, lst)) ->
Format.printf "Ok! Some list %#i@." (List.length lst)
| Ok None -> Format.printf "Ok! None?@."
| Error (#Mimic.error as e) ->
Format.printf "Mimic error: %a@." Mimic.pp_error e
| Error (`Exn e) -> Format.printf "Git error: %s@." (Printexc.to_string e)
| Error _ -> Format.printf "Git error: <unknown private error tag>@."
let () = Lwt_main.run (main ())
(It prints Ok! Some list 5
on my computer)
It fails! Mimic error: Handshake got an error
. Should this be reported at the mimic repo, or ocaml-git?
ocaml-git
seems to be the one producing the error as they are reusing the `Msg polymorphic variant to signal handshake errors, but mimic looks otherwise unrelated to the issue (it just had a nice pp_error
for this test ^^)
Hi! In case it helps, I can also reproduce the Mimic error
thing mentioned by @kentookura on macOS 14.5.
Hello, I have the following code which raises an inscrutable error:
Now, the error actually gets raised by ocaml-git, so perhaps I should rather report it in that repo. Nontheless, the code is virtually the same as the one found in the sync example.
Some notes:
Invalid_argument("Sync.pull_exn: not found")
Handshake got an error
, so I don't think it has something to do with the particulars of the sourcehut git server.I'll try to run my code on my native linux machine. If this ends up working, I can confirm that there is a bug when running ocaml-git on WSL.