From 5a242990d9c82e9c821b4c97c7400cba71bf6e61 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Fri, 20 Sep 2024 13:22:44 +0200 Subject: [PATCH 1/2] Remame vcs-git => vcs-git-eio --- CHANGES.md | 1 + dune-project | 8 ++++---- example/dune | 2 +- example/hello_error.ml | 2 +- example/hello_git_cli.ml | 2 +- example/hello_vcs.ml | 2 +- lib/vcs/src/vcs.mli | 2 +- lib/vcs_arg/src/dune | 2 +- lib/vcs_arg/src/vcs_arg.ml | 6 +++--- lib/vcs_arg/src/vcs_arg.mli | 2 +- lib/vcs_command/src/dune | 2 +- lib/{vcs_git => vcs_git_eio}/src/dune | 4 ++-- lib/{vcs_git => vcs_git_eio}/src/runtime.ml | 0 lib/{vcs_git => vcs_git_eio}/src/runtime.mli | 0 .../src/vcs_git.ml => vcs_git_eio/src/vcs_git_eio.ml} | 0 .../src/vcs_git.mli => vcs_git_eio/src/vcs_git_eio.mli} | 0 lib/{vcs_git => vcs_git_eio}/test/dune | 6 +++--- lib/{vcs_git => vcs_git_eio}/test/test__hello_commit.ml | 2 +- lib/{vcs_git => vcs_git_eio}/test/test__hello_commit.mli | 0 lib/{vcs_git => vcs_git_eio}/test/test__init.ml | 2 +- lib/{vcs_git => vcs_git_eio}/test/test__init.mli | 0 lib/vcs_test_helpers/test/dune | 2 +- lib/vcs_test_helpers/test/test__vcs_test_helpers.ml | 4 ++-- test/expect/dune | 2 +- test/expect/find_ref.ml | 2 +- test/expect/nonraising_unit_tests.ml | 2 +- test/expect/num_status_without_lines.ml | 2 +- vcs-arg.opam | 2 +- vcs-command.opam | 2 +- vcs-git.opam => vcs-git-eio.opam | 0 vcs-tests.opam | 2 +- 31 files changed, 33 insertions(+), 32 deletions(-) rename lib/{vcs_git => vcs_git_eio}/src/dune (91%) rename lib/{vcs_git => vcs_git_eio}/src/runtime.ml (100%) rename lib/{vcs_git => vcs_git_eio}/src/runtime.mli (100%) rename lib/{vcs_git/src/vcs_git.ml => vcs_git_eio/src/vcs_git_eio.ml} (100%) rename lib/{vcs_git/src/vcs_git.mli => vcs_git_eio/src/vcs_git_eio.mli} (100%) rename lib/{vcs_git => vcs_git_eio}/test/dune (88%) rename lib/{vcs_git => vcs_git_eio}/test/test__hello_commit.ml (98%) rename lib/{vcs_git => vcs_git_eio}/test/test__hello_commit.mli (100%) rename lib/{vcs_git => vcs_git_eio}/test/test__init.ml (98%) rename lib/{vcs_git => vcs_git_eio}/test/test__init.mli (100%) rename vcs-git.opam => vcs-git-eio.opam (100%) diff --git a/CHANGES.md b/CHANGES.md index dd5487a..ce6125c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ### Changed +- Rename `vcs-git` to `vcs-git-eio` (breaking change). - Rename `tree` to `graph` to designate the commit graph of a repository (breaking change). - Upgrade to `cmdlang.0.0.5`. diff --git a/dune-project b/dune-project index 696af4b..f766235 100644 --- a/dune-project +++ b/dune-project @@ -116,7 +116,7 @@ (>= 0.33)) (vcs (= :version)) - (vcs-git + (vcs-git-eio (= :version)))) (package @@ -181,7 +181,7 @@ (= :version)) (vcs-arg (= :version)) - (vcs-git + (vcs-git-eio (= :version)) (vcs-private-libs-eio (= :version)))) @@ -234,7 +234,7 @@ (= :version)))) (package - (name vcs-git) + (name vcs-git-eio) (synopsis "A Git provider for Vcs based on Vcs_git_cli for Eio programs") (depends (ocaml @@ -453,7 +453,7 @@ (= :version)) (vcs-command (= :version)) - (vcs-git + (vcs-git-eio (= :version)) (vcs-git-blocking (= :version)) diff --git a/example/dune b/example/dune index a85c988..c21da82 100644 --- a/example/dune +++ b/example/dune @@ -24,7 +24,7 @@ fpath fpath-base vcs - vcs_git + vcs_git_eio vcs_git_blocking vcs_test_helpers) (instrumentation diff --git a/example/hello_error.ml b/example/hello_error.ml index a77e654..062e8b9 100644 --- a/example/hello_error.ml +++ b/example/hello_error.ml @@ -26,7 +26,7 @@ let%expect_test "hello error" = Eio_main.run @@ fun env -> - let vcs = Vcs_git.create ~env in + let vcs = Vcs_git_eio.create ~env in let invalid_path = Absolute_path.v "/invalid/path" in let redact_sexp sexp = (* Because the actual error may become too brittle overtime, we actually diff --git a/example/hello_git_cli.ml b/example/hello_git_cli.ml index 01c4796..77cc3e0 100644 --- a/example/hello_git_cli.ml +++ b/example/hello_git_cli.ml @@ -28,7 +28,7 @@ let%expect_test "hello cli" = @@ fun env -> Eio.Switch.run @@ fun sw -> - let vcs = Vcs_git.create ~env in + let vcs = Vcs_git_eio.create ~env in let repo_root = Vcs_test_helpers.init_temp_repo ~env ~sw ~vcs in let hello_file = Vcs.Path_in_repo.v "hello.txt" in Vcs.save_file diff --git a/example/hello_vcs.ml b/example/hello_vcs.ml index e231388..ae26e72 100644 --- a/example/hello_vcs.ml +++ b/example/hello_vcs.ml @@ -31,7 +31,7 @@ let%expect_test "hello commit" = (* To use the [Vcs] API, you need a [vcs] value, which you must obtain from a provider. We're using [Vcs_git] for this here. It is a provider based on [Eio] and running the [git] command line as an external process. *) - let vcs = Vcs_git.create ~env in + let vcs = Vcs_git_eio.create ~env in (* The next step takes care of creating a fresh repository. We make use of a helper library to encapsulate the required steps. *) let repo_root = Vcs_test_helpers.init_temp_repo ~env ~sw ~vcs in diff --git a/lib/vcs/src/vcs.mli b/lib/vcs/src/vcs.mli index e67ab5f..363e8bf 100644 --- a/lib/vcs/src/vcs.mli +++ b/lib/vcs/src/vcs.mli @@ -39,7 +39,7 @@ type -'a t = 'a Vcs0.t (** [create provider] returns a [vcs] that implements a given set of traits. Typical users do not use [create] directly, but rather will rely on an - actual provider. See for example [Vcs_git.create]. *) + actual provider. See for example [Vcs_git_eio.create]. *) val create : 'a Provider.t -> 'a t (** {1 Error handling} diff --git a/lib/vcs_arg/src/dune b/lib/vcs_arg/src/dune index d5eba6e..9297a90 100644 --- a/lib/vcs_arg/src/dune +++ b/lib/vcs_arg/src/dune @@ -15,7 +15,7 @@ Or_error.Let_syntax -open Cmdlang) - (libraries base cmdlang eio fpath fpath-base unix vcs vcs-git) + (libraries base cmdlang eio fpath fpath-base unix vcs vcs-git-eio) (instrumentation (backend bisect_ppx)) (lint diff --git a/lib/vcs_arg/src/vcs_arg.ml b/lib/vcs_arg/src/vcs_arg.ml index ffc2cb0..75df3ac 100644 --- a/lib/vcs_arg/src/vcs_arg.ml +++ b/lib/vcs_arg/src/vcs_arg.ml @@ -68,7 +68,7 @@ module Create_vcs_backend = struct | Some ((`Git as vcs), dir) -> let vcs = match vcs with - | `Git -> Vcs_git.create ~env + | `Git -> Vcs_git_eio.create ~env in let repo_root = repo_root dir in Some (vcs, repo_root) @@ -80,7 +80,7 @@ module Context = struct { config : Config.t ; fs : Eio.Fs.dir_ty Eio.Path.t ; cwd : Absolute_path.t - ; vcs : Vcs_git.t' + ; vcs : Vcs_git_eio.t' ; repo_root : Vcs.Repo_root.t } @@ -121,7 +121,7 @@ end module Initialized = struct type t = - { vcs : Vcs_git.t' + { vcs : Vcs_git_eio.t' ; repo_root : Vcs.Repo_root.t ; context : Context.t } diff --git a/lib/vcs_arg/src/vcs_arg.mli b/lib/vcs_arg/src/vcs_arg.mli index 00a8e57..80f9518 100644 --- a/lib/vcs_arg/src/vcs_arg.mli +++ b/lib/vcs_arg/src/vcs_arg.mli @@ -43,7 +43,7 @@ end module Initialized : sig type t = - { vcs : Vcs_git.t' + { vcs : Vcs_git_eio.t' ; repo_root : Vcs.Repo_root.t ; context : Context.t } diff --git a/lib/vcs_command/src/dune b/lib/vcs_command/src/dune index 8ef1f75..60e8fa2 100644 --- a/lib/vcs_command/src/dune +++ b/lib/vcs_command/src/dune @@ -24,7 +24,7 @@ fpath-base vcs vcs-arg - vcs-git + vcs-git-eio vcs-private-libs-eio.eio-writer) (instrumentation (backend bisect_ppx)) diff --git a/lib/vcs_git/src/dune b/lib/vcs_git_eio/src/dune similarity index 91% rename from lib/vcs_git/src/dune rename to lib/vcs_git_eio/src/dune index f87956f..9ac7269 100644 --- a/lib/vcs_git/src/dune +++ b/lib/vcs_git_eio/src/dune @@ -1,6 +1,6 @@ (library - (name vcs_git) - (public_name vcs-git) + (name vcs_git_eio) + (public_name vcs-git-eio) (flags :standard -w diff --git a/lib/vcs_git/src/runtime.ml b/lib/vcs_git_eio/src/runtime.ml similarity index 100% rename from lib/vcs_git/src/runtime.ml rename to lib/vcs_git_eio/src/runtime.ml diff --git a/lib/vcs_git/src/runtime.mli b/lib/vcs_git_eio/src/runtime.mli similarity index 100% rename from lib/vcs_git/src/runtime.mli rename to lib/vcs_git_eio/src/runtime.mli diff --git a/lib/vcs_git/src/vcs_git.ml b/lib/vcs_git_eio/src/vcs_git_eio.ml similarity index 100% rename from lib/vcs_git/src/vcs_git.ml rename to lib/vcs_git_eio/src/vcs_git_eio.ml diff --git a/lib/vcs_git/src/vcs_git.mli b/lib/vcs_git_eio/src/vcs_git_eio.mli similarity index 100% rename from lib/vcs_git/src/vcs_git.mli rename to lib/vcs_git_eio/src/vcs_git_eio.mli diff --git a/lib/vcs_git/test/dune b/lib/vcs_git_eio/test/dune similarity index 88% rename from lib/vcs_git/test/dune rename to lib/vcs_git_eio/test/dune index d6ce3e7..1211110 100644 --- a/lib/vcs_git/test/dune +++ b/lib/vcs_git_eio/test/dune @@ -1,6 +1,6 @@ (library - (name vcs_git_test) - (public_name vcs-tests.vcs_git_test) + (name vcs_git_eio_test) + (public_name vcs-tests.vcs_git_eio_test) (inline_tests) (flags :standard @@ -24,7 +24,7 @@ fpath fpath-base vcs - vcs_git + vcs_git_eio vcs_test_helpers) (instrumentation (backend bisect_ppx)) diff --git a/lib/vcs_git/test/test__hello_commit.ml b/lib/vcs_git_eio/test/test__hello_commit.ml similarity index 98% rename from lib/vcs_git/test/test__hello_commit.ml rename to lib/vcs_git_eio/test/test__hello_commit.ml index 78a10aa..8deccbe 100644 --- a/lib/vcs_git/test/test__hello_commit.ml +++ b/lib/vcs_git_eio/test/test__hello_commit.ml @@ -27,7 +27,7 @@ let%expect_test "hello commit" = @@ fun env -> Eio.Switch.run @@ fun sw -> - let vcs = Vcs_git.create ~env in + let vcs = Vcs_git_eio.create ~env in let mock_revs = Vcs.Mock_revs.create () in let repo_root = Vcs_test_helpers.init_temp_repo ~env ~sw ~vcs in let hello_file = Vcs.Path_in_repo.v "hello.txt" in diff --git a/lib/vcs_git/test/test__hello_commit.mli b/lib/vcs_git_eio/test/test__hello_commit.mli similarity index 100% rename from lib/vcs_git/test/test__hello_commit.mli rename to lib/vcs_git_eio/test/test__hello_commit.mli diff --git a/lib/vcs_git/test/test__init.ml b/lib/vcs_git_eio/test/test__init.ml similarity index 98% rename from lib/vcs_git/test/test__init.ml rename to lib/vcs_git_eio/test/test__init.ml index 5898900..2878fee 100644 --- a/lib/vcs_git/test/test__init.ml +++ b/lib/vcs_git_eio/test/test__init.ml @@ -24,7 +24,7 @@ let%expect_test "init" = @@ fun env -> Eio.Switch.run @@ fun sw -> - let vcs = Vcs_git.create ~env in + let vcs = Vcs_git_eio.create ~env in let path = Stdlib.Filename.temp_dir ~temp_dir:(Unix.getcwd ()) "vcs" "test" in let repo_root = Eio.Switch.on_release sw (fun () -> diff --git a/lib/vcs_git/test/test__init.mli b/lib/vcs_git_eio/test/test__init.mli similarity index 100% rename from lib/vcs_git/test/test__init.mli rename to lib/vcs_git_eio/test/test__init.mli diff --git a/lib/vcs_test_helpers/test/dune b/lib/vcs_test_helpers/test/dune index 744d636..b356602 100644 --- a/lib/vcs_test_helpers/test/dune +++ b/lib/vcs_test_helpers/test/dune @@ -24,7 +24,7 @@ fpath fpath-base vcs - vcs_git + vcs_git_eio vcs_test_helpers) (instrumentation (backend bisect_ppx)) diff --git a/lib/vcs_test_helpers/test/test__vcs_test_helpers.ml b/lib/vcs_test_helpers/test/test__vcs_test_helpers.ml index 1c88def..134643e 100644 --- a/lib/vcs_test_helpers/test/test__vcs_test_helpers.ml +++ b/lib/vcs_test_helpers/test/test__vcs_test_helpers.ml @@ -24,7 +24,7 @@ let%expect_test "init_temp_repo" = @@ fun env -> Eio.Switch.run @@ fun sw -> - let vcs = Vcs_git.create ~env in + let vcs = Vcs_git_eio.create ~env in let repo_root = Vcs_test_helpers.init_temp_repo ~env ~sw ~vcs in let hello_file = Vcs.Path_in_repo.v "hello.txt" in Vcs.save_file @@ -64,7 +64,7 @@ let%expect_test "init_temp_repo" = let%expect_test "redact_sexp" = Eio_main.run @@ fun env -> - let vcs = Vcs_git.create ~env in + let vcs = Vcs_git_eio.create ~env in let invalid_path = Absolute_path.v "/invalid/path" in let error = match Vcs.init vcs ~path:invalid_path with diff --git a/test/expect/dune b/test/expect/dune index f1e4bf3..c3cf9cf 100644 --- a/test/expect/dune +++ b/test/expect/dune @@ -24,7 +24,7 @@ fpath fpath-base vcs - vcs_git + vcs_git_eio vcs_git_blocking vcs_test_helpers) (instrumentation diff --git a/test/expect/find_ref.ml b/test/expect/find_ref.ml index 9dae080..ba9c1c5 100644 --- a/test/expect/find_ref.ml +++ b/test/expect/find_ref.ml @@ -37,7 +37,7 @@ let%expect_test "find ref" = @@ fun env -> Eio.Switch.run @@ fun sw -> - let vcs = Vcs_git.create ~env in + let vcs = Vcs_git_eio.create ~env in let repo_root = Vcs_test_helpers.init_temp_repo ~env ~sw ~vcs in let mock_revs = Vcs.Mock_revs.create () in let hello_file = Vcs.Path_in_repo.v "hello.txt" in diff --git a/test/expect/nonraising_unit_tests.ml b/test/expect/nonraising_unit_tests.ml index 2784115..c0b3687 100644 --- a/test/expect/nonraising_unit_tests.ml +++ b/test/expect/nonraising_unit_tests.ml @@ -53,7 +53,7 @@ let%expect_test "num stat without lines" = @@ fun env -> Eio.Switch.run @@ fun sw -> - let vcs = Vcs_git.create ~env in + let vcs = Vcs_git_eio.create ~env in let mock_revs = Vcs.Mock_revs.create () in let repo_root = Vcs_test_helpers.init_temp_repo ~env ~sw ~vcs in let () = diff --git a/test/expect/num_status_without_lines.ml b/test/expect/num_status_without_lines.ml index e1e0edc..9f409a3 100644 --- a/test/expect/num_status_without_lines.ml +++ b/test/expect/num_status_without_lines.ml @@ -27,7 +27,7 @@ let%expect_test "num stat without lines" = @@ fun env -> Eio.Switch.run @@ fun sw -> - let vcs = Vcs_git.create ~env in + let vcs = Vcs_git_eio.create ~env in let repo_root = Vcs_test_helpers.init_temp_repo ~env ~sw ~vcs in let commit_file ~path ~file_contents = Vcs.save_file diff --git a/vcs-arg.opam b/vcs-arg.opam index 982134f..6cebce6 100644 --- a/vcs-arg.opam +++ b/vcs-arg.opam @@ -24,7 +24,7 @@ depends: [ "ppx_sexp_value" {>= "v0.17" & < "v0.18"} "ppxlib" {>= "0.33"} "vcs" {= version} - "vcs-git" {= version} + "vcs-git-eio" {= version} "odoc" {with-doc} ] build: [ diff --git a/vcs-command.opam b/vcs-command.opam index 5ba8301..6561075 100644 --- a/vcs-command.opam +++ b/vcs-command.opam @@ -30,7 +30,7 @@ depends: [ "ppxlib" {>= "0.33"} "vcs" {= version} "vcs-arg" {= version} - "vcs-git" {= version} + "vcs-git-eio" {= version} "vcs-private-libs-eio" {= version} "odoc" {with-doc} ] diff --git a/vcs-git.opam b/vcs-git-eio.opam similarity index 100% rename from vcs-git.opam rename to vcs-git-eio.opam diff --git a/vcs-tests.opam b/vcs-tests.opam index 32aa217..7a22671 100644 --- a/vcs-tests.opam +++ b/vcs-tests.opam @@ -44,7 +44,7 @@ depends: [ "vcs" {= version} "vcs-arg" {= version} "vcs-command" {= version} - "vcs-git" {= version} + "vcs-git-eio" {= version} "vcs-git-blocking" {= version} "vcs-git-cli" {= version} "vcs-private-libs-base" {= version} From 35295500b99e91878b1882c2527196499af7030e Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Fri, 20 Sep 2024 13:32:35 +0200 Subject: [PATCH 2/2] Rename vcs-git-cli => vcs-git-provider --- CHANGES.md | 1 + doc/docs/design/introduction.md | 16 ++++++++-------- dune-project | 13 +++++++------ lib/vcs/test/dune | 2 +- lib/vcs/test/test__graph.ml | 4 ++-- lib/vcs/test/test__log.ml | 4 +++- lib/vcs/test/test__name_status.ml | 4 ++-- lib/vcs/test/test__num_status.ml | 2 +- lib/vcs_git_blocking/src/dune | 2 +- lib/vcs_git_blocking/src/runtime.mli | 2 +- lib/vcs_git_blocking/src/vcs_git_blocking.ml | 6 +++--- lib/vcs_git_blocking/src/vcs_git_blocking.mli | 8 ++++---- lib/vcs_git_eio/src/dune | 2 +- lib/vcs_git_eio/src/runtime.mli | 2 +- lib/vcs_git_eio/src/vcs_git_eio.ml | 6 +++--- lib/vcs_git_eio/src/vcs_git_eio.mli | 8 ++++---- .../src/add.ml | 0 .../src/add.mli | 0 .../src/branch.ml | 0 .../src/branch.mli | 0 .../src/commit.ml | 0 .../src/commit.mli | 0 .../src/config.ml | 0 .../src/config.mli | 0 .../src/dune | 4 ++-- .../src/init.ml | 0 .../src/init.mli | 0 .../src/log.ml | 0 .../src/log.mli | 0 .../src/ls_files.ml | 0 .../src/ls_files.mli | 0 .../src/munged_path.ml | 5 ++++- .../src/munged_path.mli | 0 .../src/name_status.ml | 0 .../src/name_status.mli | 0 .../src/num_status.ml | 0 .../src/num_status.mli | 0 .../src/refs.ml | 0 .../src/refs.mli | 0 .../src/rev_parse.ml | 0 .../src/rev_parse.mli | 0 .../src/runtime.mli | 2 +- .../src/show.ml | 0 .../src/show.mli | 0 .../src/vcs_git_provider.ml} | 0 .../src/vcs_git_provider.mli} | 19 ++++++++++--------- .../test/README.md | 2 +- .../test/dune | 6 +++--- .../test/test__log.ml | 6 ++++-- .../test/test__log.mli | 0 .../test/test__munged_path.ml | 8 ++++---- .../test/test__munged_path.mli | 0 .../test/test__name_status.ml | 13 ++++++++----- .../test/test__name_status.mli | 0 .../test/test__num_status.ml | 6 +++--- .../test/test__num_status.mli | 0 .../test/test__refs.ml | 7 ++++--- .../test/test__refs.mli | 0 .../test/test__show.ml | 2 +- .../test/test__show.mli | 0 vcs-git-blocking.opam | 5 +++-- vcs-git-eio.opam | 4 ++-- vcs-git-cli.opam => vcs-git-provider.opam | 0 vcs-tests.opam | 2 +- 64 files changed, 94 insertions(+), 79 deletions(-) rename lib/{vcs_git_cli => vcs_git_provider}/src/add.ml (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/add.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/branch.ml (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/branch.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/commit.ml (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/commit.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/config.ml (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/config.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/dune (89%) rename lib/{vcs_git_cli => vcs_git_provider}/src/init.ml (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/init.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/log.ml (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/log.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/ls_files.ml (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/ls_files.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/munged_path.ml (95%) rename lib/{vcs_git_cli => vcs_git_provider}/src/munged_path.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/name_status.ml (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/name_status.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/num_status.ml (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/num_status.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/refs.ml (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/refs.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/rev_parse.ml (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/rev_parse.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/runtime.mli (96%) rename lib/{vcs_git_cli => vcs_git_provider}/src/show.ml (100%) rename lib/{vcs_git_cli => vcs_git_provider}/src/show.mli (100%) rename lib/{vcs_git_cli/src/vcs_git_cli.ml => vcs_git_provider/src/vcs_git_provider.ml} (100%) rename lib/{vcs_git_cli/src/vcs_git_cli.mli => vcs_git_provider/src/vcs_git_provider.mli} (86%) rename lib/{vcs_git_cli => vcs_git_provider}/test/README.md (84%) rename lib/{vcs_git_cli => vcs_git_provider}/test/dune (91%) rename lib/{vcs_git_cli => vcs_git_provider}/test/test__log.ml (95%) rename lib/{vcs_git_cli => vcs_git_provider}/test/test__log.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/test/test__munged_path.ml (93%) rename lib/{vcs_git_cli => vcs_git_provider}/test/test__munged_path.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/test/test__name_status.ml (95%) rename lib/{vcs_git_cli => vcs_git_provider}/test/test__name_status.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/test/test__num_status.ml (98%) rename lib/{vcs_git_cli => vcs_git_provider}/test/test__num_status.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/test/test__refs.ml (94%) rename lib/{vcs_git_cli => vcs_git_provider}/test/test__refs.mli (100%) rename lib/{vcs_git_cli => vcs_git_provider}/test/test__show.ml (97%) rename lib/{vcs_git_cli => vcs_git_provider}/test/test__show.mli (100%) rename vcs-git-cli.opam => vcs-git-provider.opam (100%) diff --git a/CHANGES.md b/CHANGES.md index ce6125c..e53b6e9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ### Changed +- Rename `vcs-git-cli` to `vcs-git-provider` (breaking change). - Rename `vcs-git` to `vcs-git-eio` (breaking change). - Rename `tree` to `graph` to designate the commit graph of a repository (breaking change). - Upgrade to `cmdlang.0.0.5`. diff --git a/doc/docs/design/introduction.md b/doc/docs/design/introduction.md index b739cfc..9c43885 100644 --- a/doc/docs/design/introduction.md +++ b/doc/docs/design/introduction.md @@ -16,13 +16,13 @@ The `vcs` repository contains several components: stateDiagram-v2 vcs : vcs * user : user-lib * - vcs_git_cli : vcs-git-cli + vcs_git_provider : vcs-git-provider executable : executable (eio) - provider : vcs-git + provider : vcs-git-eio runtime : eio vcs --> user user --> executable - vcs_git_cli --> provider + vcs_git_provider --> provider runtime --> provider provider --> executable ``` @@ -33,21 +33,21 @@ stateDiagram-v2 Also marked with a * to indicate no runtime dependencies. - **executable**: A placeholder for a runtime component based on `user-lib` that commits to a specific provider and concurrency model. -- **vcs-git-cli**: A IO-free library that parses the output of a `git` cli process. -- **vcs-git**: An instantiation of `Vcs_git_cli` based on an `Eio` runtime. -- **vcs-git-blocking**: An instantiation of `Vcs_git_cli` based on the OCaml `Stdlib`. +- **vcs-git-provider**: A IO-free library that parses the output of a `git` cli process. +- **vcs-git-eio**: An instantiation of `Vcs_git_provider` based on an `Eio` runtime. +- **vcs-git-blocking**: An instantiation of `Vcs_git_provider` based on the OCaml `Stdlib`. ```mermaid stateDiagram-v2 vcs : vcs * user : user-lib * - vcs_git_cli : vcs-git-cli + vcs_git_provider : vcs-git-provider executable : executable (blocking) provider : vcs-git-blocking runtime : stdlib vcs --> user user --> executable - vcs_git_cli --> provider + vcs_git_provider --> provider runtime --> provider provider --> executable ``` diff --git a/dune-project b/dune-project index f766235..321de12 100644 --- a/dune-project +++ b/dune-project @@ -187,7 +187,7 @@ (= :version)))) (package - (name vcs-git-cli) + (name vcs-git-provider) (synopsis "An IO-free library that parses the output of Git commands") (depends (ocaml @@ -235,7 +235,8 @@ (package (name vcs-git-eio) - (synopsis "A Git provider for Vcs based on Vcs_git_cli for Eio programs") + (synopsis + "A Git provider for Vcs based on Vcs_git_provider for Eio programs") (depends (ocaml (>= 5.2)) @@ -283,7 +284,7 @@ (>= 0.0.8)) (vcs (= :version)) - (vcs-git-cli + (vcs-git-provider (= :version)) (vcs-private-libs-eio (= :version)))) @@ -291,7 +292,7 @@ (package (name vcs-git-blocking) (synopsis - "A Git provider for Vcs based on Vcs_git_cli for blocking programs") + "A Git provider for Vcs based on Vcs_git_provider for blocking programs") (depends (ocaml (>= 5.2)) @@ -337,7 +338,7 @@ (>= 0.0.8)) (vcs (= :version)) - (vcs-git-cli + (vcs-git-provider (= :version)))) (package @@ -457,7 +458,7 @@ (= :version)) (vcs-git-blocking (= :version)) - (vcs-git-cli + (vcs-git-provider (= :version)) (vcs-private-libs-base (= :version)) diff --git a/lib/vcs/test/dune b/lib/vcs/test/dune index 2a4489c..446bce2 100644 --- a/lib/vcs/test/dune +++ b/lib/vcs/test/dune @@ -30,7 +30,7 @@ fpath fpath-base vcs - vcs_git_cli) + vcs_git_provider) (instrumentation (backend bisect_ppx)) (lint diff --git a/lib/vcs/test/test__graph.ml b/lib/vcs/test/test__graph.ml index b997f65..ec6d485 100644 --- a/lib/vcs/test/test__graph.ml +++ b/lib/vcs/test/test__graph.ml @@ -26,13 +26,13 @@ let%expect_test "graph" = let path = Eio.Path.(Eio.Stdenv.fs env / "super-master-mind.log") in let contents = Eio.Path.load path in let lines = String.split_lines contents in - List.map lines ~f:(fun line -> Vcs_git_cli.Log.parse_log_line_exn ~line) + List.map lines ~f:(fun line -> Vcs_git_provider.Log.parse_log_line_exn ~line) in let refs = let path = Eio.Path.(Eio.Stdenv.fs env / "super-master-mind.refs") in let contents = Eio.Path.load path in let lines = String.split_lines contents in - Vcs_git_cli.Refs.parse_lines_exn ~lines + Vcs_git_provider.Refs.parse_lines_exn ~lines in let graph = Vcs.Graph.create () in print_s [%sexp { node_count = (Vcs.Graph.node_count graph : int) }]; diff --git a/lib/vcs/test/test__log.ml b/lib/vcs/test/test__log.ml index 04d9bf1..75939a7 100644 --- a/lib/vcs/test/test__log.ml +++ b/lib/vcs/test/test__log.ml @@ -27,7 +27,9 @@ let%expect_test "parse_exn" = let path = Eio.Path.(Eio.Stdenv.fs env / "super-master-mind.log") in let contents = Eio.Path.load path in let lines = String.split_lines contents in - let log = List.map lines ~f:(fun line -> Vcs_git_cli.Log.parse_log_line_exn ~line) in + let log = + List.map lines ~f:(fun line -> Vcs_git_provider.Log.parse_log_line_exn ~line) + in let roots = Vcs.Log.roots log in print_s [%sexp (roots : Vcs.Rev.t list)]; [%expect diff --git a/lib/vcs/test/test__name_status.ml b/lib/vcs/test/test__name_status.ml index 092837d..911a7d7 100644 --- a/lib/vcs/test/test__name_status.ml +++ b/lib/vcs/test/test__name_status.ml @@ -25,7 +25,7 @@ let%expect_test "parse_exn" = let path = Eio.Path.(Eio.Stdenv.fs env / "super-master-mind.name-status") in let contents = Eio.Path.load path in let lines = String.split_lines contents in - let name_status = Vcs_git_cli.Name_status.parse_lines_exn ~lines in + let name_status = Vcs_git_provider.Name_status.parse_lines_exn ~lines in let files_at_src = Vcs.Name_status.files_at_src name_status in let files_at_dst = Vcs.Name_status.files_at_dst name_status in print_s [%sexp (Set.diff files_at_dst files_at_src : Set.M(Vcs.Path_in_repo).t)]; @@ -47,7 +47,7 @@ let%expect_test "files" = ; "R100\toriginal_renamed_file\tnew_renamed_file" ] in - let name_status = Vcs_git_cli.Name_status.parse_lines_exn ~lines in + let name_status = Vcs_git_provider.Name_status.parse_lines_exn ~lines in print_s [%sexp (name_status : Vcs.Name_status.t)]; [%expect {| diff --git a/lib/vcs/test/test__num_status.ml b/lib/vcs/test/test__num_status.ml index c2583e6..e05e64a 100644 --- a/lib/vcs/test/test__num_status.ml +++ b/lib/vcs/test/test__num_status.ml @@ -25,7 +25,7 @@ let%expect_test "parse_exn" = let path = Eio.Path.(Eio.Stdenv.fs env / "super-master-mind.num-status") in let contents = Eio.Path.load path in let lines = String.split_lines contents in - let num_status = Vcs_git_cli.Num_status.parse_lines_exn ~lines in + let num_status = Vcs_git_provider.Num_status.parse_lines_exn ~lines in ignore (num_status : Vcs.Num_status.t); [%expect {||}]; () diff --git a/lib/vcs_git_blocking/src/dune b/lib/vcs_git_blocking/src/dune index 458f859..5bb3c34 100644 --- a/lib/vcs_git_blocking/src/dune +++ b/lib/vcs_git_blocking/src/dune @@ -11,7 +11,7 @@ Base -open Fpath_base) - (libraries base fpath fpath-base provider unix vcs vcs-git-cli) + (libraries base fpath fpath-base provider unix vcs vcs-git-provider) (instrumentation (backend bisect_ppx)) (lint diff --git a/lib/vcs_git_blocking/src/runtime.mli b/lib/vcs_git_blocking/src/runtime.mli index f6fd6dc..3a0144f 100644 --- a/lib/vcs_git_blocking/src/runtime.mli +++ b/lib/vcs_git_blocking/src/runtime.mli @@ -21,6 +21,6 @@ type t -include Vcs_git_cli.Runtime.S with type t := t +include Vcs_git_provider.Runtime.S with type t := t val create : unit -> t diff --git a/lib/vcs_git_blocking/src/vcs_git_blocking.ml b/lib/vcs_git_blocking/src/vcs_git_blocking.ml index d7529a6..ce6f507 100644 --- a/lib/vcs_git_blocking/src/vcs_git_blocking.ml +++ b/lib/vcs_git_blocking/src/vcs_git_blocking.ml @@ -19,12 +19,12 @@ (* and , respectively. *) (*******************************************************************************) -type 'a t = ([> Vcs_git_cli.Trait.t ] as 'a) Vcs.t -type t' = Vcs_git_cli.Trait.t t +type 'a t = ([> Vcs_git_provider.Trait.t ] as 'a) Vcs.t +type t' = Vcs_git_provider.Trait.t t module Impl = struct include Runtime - include Vcs_git_cli.Make (Runtime) + include Vcs_git_provider.Make (Runtime) end let create () = Vcs.create (Provider.T { t = Impl.create (); handler = Impl.handler () }) diff --git a/lib/vcs_git_blocking/src/vcs_git_blocking.mli b/lib/vcs_git_blocking/src/vcs_git_blocking.mli index 20a55ff..b644fba 100644 --- a/lib/vcs_git_blocking/src/vcs_git_blocking.mli +++ b/lib/vcs_git_blocking/src/vcs_git_blocking.mli @@ -20,18 +20,18 @@ (*_******************************************************************************) (** Implementation of a git provider for the {!module:Vcs} library, based on - [Stdlib] and {!module:Vcs_git_cli}. + [Stdlib] and {!module:Vcs_git_provider}. This implementation is based on the [git] command line tool. We run it as an external program with utils from [Stdlib] and [Unix], producing the right command line invocation and parsing the output to produce a typed version of - the expected results with [Vcs_git_cli]. Note that [git] must be found in the + the expected results with [Vcs_git_provider]. Note that [git] must be found in the PATH of the running environment. *) -type 'a t = ([> Vcs_git_cli.Trait.t ] as 'a) Vcs.t +type 'a t = ([> Vcs_git_provider.Trait.t ] as 'a) Vcs.t (** This is a convenient type alias that may be used to designate a provider with the exact list of traits supported by this implementation. *) -type t' = Vcs_git_cli.Trait.t t +type t' = Vcs_git_provider.Trait.t t val create : unit -> _ t diff --git a/lib/vcs_git_eio/src/dune b/lib/vcs_git_eio/src/dune index 9ac7269..e6ffc46 100644 --- a/lib/vcs_git_eio/src/dune +++ b/lib/vcs_git_eio/src/dune @@ -21,7 +21,7 @@ fpath fpath-base vcs - vcs-git-cli + vcs-git-provider vcs-private-libs-eio.eio-process) (instrumentation (backend bisect_ppx)) diff --git a/lib/vcs_git_eio/src/runtime.mli b/lib/vcs_git_eio/src/runtime.mli index c099ee5..c4491bf 100644 --- a/lib/vcs_git_eio/src/runtime.mli +++ b/lib/vcs_git_eio/src/runtime.mli @@ -21,6 +21,6 @@ type t -include Vcs_git_cli.Runtime.S with type t := t +include Vcs_git_provider.Runtime.S with type t := t val create : env:< fs : _ Eio.Path.t ; process_mgr : _ Eio.Process.mgr ; .. > -> t diff --git a/lib/vcs_git_eio/src/vcs_git_eio.ml b/lib/vcs_git_eio/src/vcs_git_eio.ml index 881ead5..c6d4218 100644 --- a/lib/vcs_git_eio/src/vcs_git_eio.ml +++ b/lib/vcs_git_eio/src/vcs_git_eio.ml @@ -19,12 +19,12 @@ (* and , respectively. *) (*******************************************************************************) -type 'a t = ([> Vcs_git_cli.Trait.t ] as 'a) Vcs.t -type t' = Vcs_git_cli.Trait.t t +type 'a t = ([> Vcs_git_provider.Trait.t ] as 'a) Vcs.t +type t' = Vcs_git_provider.Trait.t t module Impl = struct include Runtime - include Vcs_git_cli.Make (Runtime) + include Vcs_git_provider.Make (Runtime) end let create ~env = diff --git a/lib/vcs_git_eio/src/vcs_git_eio.mli b/lib/vcs_git_eio/src/vcs_git_eio.mli index 9d0d991..23128cc 100644 --- a/lib/vcs_git_eio/src/vcs_git_eio.mli +++ b/lib/vcs_git_eio/src/vcs_git_eio.mli @@ -20,19 +20,19 @@ (*_******************************************************************************) (** Implementation of a git provider for the {!module:Vcs} library, based on - [Eio] and {!module:Vcs_git_cli}. + [Eio] and {!module:Vcs_git_provider}. This implementation is based on the [git] command line tool. We run it as an external program within an [Eio] environment, producing the right command line invocation and parsing the output to produce a typed version of the expected - results with [Vcs_git_cli]. Note that [git] must be found in the PATH of the + results with [Vcs_git_provider]. Note that [git] must be found in the PATH of the running environment. *) -type 'a t = ([> Vcs_git_cli.Trait.t ] as 'a) Vcs.t +type 'a t = ([> Vcs_git_provider.Trait.t ] as 'a) Vcs.t (** This is a convenient type alias that may be used to designate a provider with the exact list of traits supported by this implementation. *) -type t' = Vcs_git_cli.Trait.t t +type t' = Vcs_git_provider.Trait.t t (** [create ~env] creates a [vcs] value that can be used by the {!module:Vcs} library. *) diff --git a/lib/vcs_git_cli/src/add.ml b/lib/vcs_git_provider/src/add.ml similarity index 100% rename from lib/vcs_git_cli/src/add.ml rename to lib/vcs_git_provider/src/add.ml diff --git a/lib/vcs_git_cli/src/add.mli b/lib/vcs_git_provider/src/add.mli similarity index 100% rename from lib/vcs_git_cli/src/add.mli rename to lib/vcs_git_provider/src/add.mli diff --git a/lib/vcs_git_cli/src/branch.ml b/lib/vcs_git_provider/src/branch.ml similarity index 100% rename from lib/vcs_git_cli/src/branch.ml rename to lib/vcs_git_provider/src/branch.ml diff --git a/lib/vcs_git_cli/src/branch.mli b/lib/vcs_git_provider/src/branch.mli similarity index 100% rename from lib/vcs_git_cli/src/branch.mli rename to lib/vcs_git_provider/src/branch.mli diff --git a/lib/vcs_git_cli/src/commit.ml b/lib/vcs_git_provider/src/commit.ml similarity index 100% rename from lib/vcs_git_cli/src/commit.ml rename to lib/vcs_git_provider/src/commit.ml diff --git a/lib/vcs_git_cli/src/commit.mli b/lib/vcs_git_provider/src/commit.mli similarity index 100% rename from lib/vcs_git_cli/src/commit.mli rename to lib/vcs_git_provider/src/commit.mli diff --git a/lib/vcs_git_cli/src/config.ml b/lib/vcs_git_provider/src/config.ml similarity index 100% rename from lib/vcs_git_cli/src/config.ml rename to lib/vcs_git_provider/src/config.ml diff --git a/lib/vcs_git_cli/src/config.mli b/lib/vcs_git_provider/src/config.mli similarity index 100% rename from lib/vcs_git_cli/src/config.mli rename to lib/vcs_git_provider/src/config.mli diff --git a/lib/vcs_git_cli/src/dune b/lib/vcs_git_provider/src/dune similarity index 89% rename from lib/vcs_git_cli/src/dune rename to lib/vcs_git_provider/src/dune index 04d6279..de7675b 100644 --- a/lib/vcs_git_cli/src/dune +++ b/lib/vcs_git_provider/src/dune @@ -1,6 +1,6 @@ (library - (name vcs_git_cli) - (public_name vcs-git-cli) + (name vcs_git_provider) + (public_name vcs-git-provider) (flags :standard -w diff --git a/lib/vcs_git_cli/src/init.ml b/lib/vcs_git_provider/src/init.ml similarity index 100% rename from lib/vcs_git_cli/src/init.ml rename to lib/vcs_git_provider/src/init.ml diff --git a/lib/vcs_git_cli/src/init.mli b/lib/vcs_git_provider/src/init.mli similarity index 100% rename from lib/vcs_git_cli/src/init.mli rename to lib/vcs_git_provider/src/init.mli diff --git a/lib/vcs_git_cli/src/log.ml b/lib/vcs_git_provider/src/log.ml similarity index 100% rename from lib/vcs_git_cli/src/log.ml rename to lib/vcs_git_provider/src/log.ml diff --git a/lib/vcs_git_cli/src/log.mli b/lib/vcs_git_provider/src/log.mli similarity index 100% rename from lib/vcs_git_cli/src/log.mli rename to lib/vcs_git_provider/src/log.mli diff --git a/lib/vcs_git_cli/src/ls_files.ml b/lib/vcs_git_provider/src/ls_files.ml similarity index 100% rename from lib/vcs_git_cli/src/ls_files.ml rename to lib/vcs_git_provider/src/ls_files.ml diff --git a/lib/vcs_git_cli/src/ls_files.mli b/lib/vcs_git_provider/src/ls_files.mli similarity index 100% rename from lib/vcs_git_cli/src/ls_files.mli rename to lib/vcs_git_provider/src/ls_files.mli diff --git a/lib/vcs_git_cli/src/munged_path.ml b/lib/vcs_git_provider/src/munged_path.ml similarity index 95% rename from lib/vcs_git_cli/src/munged_path.ml rename to lib/vcs_git_provider/src/munged_path.ml index d84e2d8..50d8dd5 100644 --- a/lib/vcs_git_cli/src/munged_path.ml +++ b/lib/vcs_git_provider/src/munged_path.ml @@ -55,5 +55,8 @@ let parse_exn str = | exn -> raise_s [%sexp - "Vcs_git_cli.Munged_path.parse_exn", "invalid path", (str : string), (exn : Exn.t)] + "Vcs_git_provider.Munged_path.parse_exn" + , "invalid path" + , (str : string) + , (exn : Exn.t)] ;; diff --git a/lib/vcs_git_cli/src/munged_path.mli b/lib/vcs_git_provider/src/munged_path.mli similarity index 100% rename from lib/vcs_git_cli/src/munged_path.mli rename to lib/vcs_git_provider/src/munged_path.mli diff --git a/lib/vcs_git_cli/src/name_status.ml b/lib/vcs_git_provider/src/name_status.ml similarity index 100% rename from lib/vcs_git_cli/src/name_status.ml rename to lib/vcs_git_provider/src/name_status.ml diff --git a/lib/vcs_git_cli/src/name_status.mli b/lib/vcs_git_provider/src/name_status.mli similarity index 100% rename from lib/vcs_git_cli/src/name_status.mli rename to lib/vcs_git_provider/src/name_status.mli diff --git a/lib/vcs_git_cli/src/num_status.ml b/lib/vcs_git_provider/src/num_status.ml similarity index 100% rename from lib/vcs_git_cli/src/num_status.ml rename to lib/vcs_git_provider/src/num_status.ml diff --git a/lib/vcs_git_cli/src/num_status.mli b/lib/vcs_git_provider/src/num_status.mli similarity index 100% rename from lib/vcs_git_cli/src/num_status.mli rename to lib/vcs_git_provider/src/num_status.mli diff --git a/lib/vcs_git_cli/src/refs.ml b/lib/vcs_git_provider/src/refs.ml similarity index 100% rename from lib/vcs_git_cli/src/refs.ml rename to lib/vcs_git_provider/src/refs.ml diff --git a/lib/vcs_git_cli/src/refs.mli b/lib/vcs_git_provider/src/refs.mli similarity index 100% rename from lib/vcs_git_cli/src/refs.mli rename to lib/vcs_git_provider/src/refs.mli diff --git a/lib/vcs_git_cli/src/rev_parse.ml b/lib/vcs_git_provider/src/rev_parse.ml similarity index 100% rename from lib/vcs_git_cli/src/rev_parse.ml rename to lib/vcs_git_provider/src/rev_parse.ml diff --git a/lib/vcs_git_cli/src/rev_parse.mli b/lib/vcs_git_provider/src/rev_parse.mli similarity index 100% rename from lib/vcs_git_cli/src/rev_parse.mli rename to lib/vcs_git_provider/src/rev_parse.mli diff --git a/lib/vcs_git_cli/src/runtime.mli b/lib/vcs_git_provider/src/runtime.mli similarity index 96% rename from lib/vcs_git_cli/src/runtime.mli rename to lib/vcs_git_provider/src/runtime.mli index 2e312fc..b3007aa 100644 --- a/lib/vcs_git_cli/src/runtime.mli +++ b/lib/vcs_git_provider/src/runtime.mli @@ -21,7 +21,7 @@ (** Defining the interface of a compatible runtime. - The other modules defined by [Vcs_git_cli] are all functors that are + The other modules defined by [Vcs_git_provider] are all functors that are parametrized by this interface. *) module type S = sig diff --git a/lib/vcs_git_cli/src/show.ml b/lib/vcs_git_provider/src/show.ml similarity index 100% rename from lib/vcs_git_cli/src/show.ml rename to lib/vcs_git_provider/src/show.ml diff --git a/lib/vcs_git_cli/src/show.mli b/lib/vcs_git_provider/src/show.mli similarity index 100% rename from lib/vcs_git_cli/src/show.mli rename to lib/vcs_git_provider/src/show.mli diff --git a/lib/vcs_git_cli/src/vcs_git_cli.ml b/lib/vcs_git_provider/src/vcs_git_provider.ml similarity index 100% rename from lib/vcs_git_cli/src/vcs_git_cli.ml rename to lib/vcs_git_provider/src/vcs_git_provider.ml diff --git a/lib/vcs_git_cli/src/vcs_git_cli.mli b/lib/vcs_git_provider/src/vcs_git_provider.mli similarity index 86% rename from lib/vcs_git_cli/src/vcs_git_cli.mli rename to lib/vcs_git_provider/src/vcs_git_provider.mli index 6dbd70c..96ad891 100644 --- a/lib/vcs_git_cli/src/vcs_git_cli.mli +++ b/lib/vcs_git_provider/src/vcs_git_provider.mli @@ -19,18 +19,19 @@ (*_ and , respectively. *) (*_******************************************************************************) -(** [Vcs_git_cli] is a helper library to build git providers for the [Vcs] library. +(** [Vcs_git_provider] is a helper library to build git providers for the [Vcs] + library. - Given the ability to run a [git] process, [Vcs_git_cli] knows what command to - run, how to parse its output and how to interpret its exit code to turn it - into a typed result. + Given the ability to run a [git] process, [Vcs_git_provider] knows what + command to run, how to parse its output and how to interpret its exit code + to turn it into a typed result. - [Vcs_git_cli] is not meant to be used directly by a user. Rather it is one of - the building blocks involved in creating a git provider for the [Vcs] + [Vcs_git_provider] is not meant to be used directly by a user. Rather it is + one of the building blocks involved in creating a git provider for the [Vcs] library. - [Vcs_git_cli] has currently two instantiations as part of its distribution - (packaged separately to keep the dependencies isolated). + [Vcs_git_provider] has currently two instantiations as part of its + distribution (packaged separately to keep the dependencies isolated). - One based on the [Eio] runtime - One based on the [Stdlib.Unix] runtime, for blocking programs. @@ -46,7 +47,7 @@ module Runtime = Runtime (** {1 Providers of Vcs Traits} *) module Trait : sig - (** The list of traits that are implemented in [Vcs_git_cli]. *) + (** The list of traits that are implemented in [Vcs_git_provider]. *) type t = [ Vcs.Trait.add | Vcs.Trait.branch diff --git a/lib/vcs_git_cli/test/README.md b/lib/vcs_git_provider/test/README.md similarity index 84% rename from lib/vcs_git_cli/test/README.md rename to lib/vcs_git_provider/test/README.md index 8c808ff..768309b 100644 --- a/lib/vcs_git_cli/test/README.md +++ b/lib/vcs_git_provider/test/README.md @@ -1,6 +1,6 @@ # Testing the Git Command Line Interface Parsing Logic -This directory contains tests for the parsing logic implemented in the `Vcs_git_cli` module. The focus here is on validating the parsing of specific command outputs, rather than testing the entire process invocation. The latter is covered in the `Vcs_git_test` module. +This directory contains tests for the parsing logic implemented in the `Vcs_git_provider` module. The focus here is on validating the parsing of specific command outputs, rather than testing the entire process invocation. The latter is covered in the `Vcs_git_test` module. ## Testing Pattern diff --git a/lib/vcs_git_cli/test/dune b/lib/vcs_git_provider/test/dune similarity index 91% rename from lib/vcs_git_cli/test/dune rename to lib/vcs_git_provider/test/dune index a7b80fd..814817a 100644 --- a/lib/vcs_git_cli/test/dune +++ b/lib/vcs_git_provider/test/dune @@ -1,6 +1,6 @@ (library - (name vcs_git_cli_test) - (public_name vcs-tests.vcs_git_cli_test) + (name vcs_git_provider_test) + (public_name vcs-tests.vcs_git_provider_test) (inline_tests (deps (glob_files *.name-status) @@ -22,7 +22,7 @@ eio eio_main expect_test_helpers_core.expect_test_helpers_base - vcs_git_cli) + vcs_git_provider) (instrumentation (backend bisect_ppx)) (lint diff --git a/lib/vcs_git_cli/test/test__log.ml b/lib/vcs_git_provider/test/test__log.ml similarity index 95% rename from lib/vcs_git_cli/test/test__log.ml rename to lib/vcs_git_provider/test/test__log.ml index f9c81bd..cc0013c 100644 --- a/lib/vcs_git_cli/test/test__log.ml +++ b/lib/vcs_git_provider/test/test__log.ml @@ -33,7 +33,9 @@ let%expect_test "parse_exn" = let path = Eio.Path.(Eio.Stdenv.fs env / "super-master-mind.log") in let contents = Eio.Path.load path in let lines = String.split_lines contents in - let log = List.map lines ~f:(fun line -> Vcs_git_cli.Log.parse_log_line_exn ~line) in + let log = + List.map lines ~f:(fun line -> Vcs_git_provider.Log.parse_log_line_exn ~line) + in let roots = Vcs.Log.roots log in print_s [%sexp (roots : Vcs.Rev.t list)]; [%expect @@ -52,7 +54,7 @@ let%expect_test "parse_exn" = let%expect_test "invalid lines" = let test line = - print_s [%sexp (Vcs_git_cli.Log.parse_log_line_exn ~line : Vcs.Log.Line.t)] + print_s [%sexp (Vcs_git_provider.Log.parse_log_line_exn ~line : Vcs.Log.Line.t)] in test "35760b109070be51b9deb61c8fdc79c0b2d9065d"; [%expect {| (Root (rev 35760b109070be51b9deb61c8fdc79c0b2d9065d)) |}]; diff --git a/lib/vcs_git_cli/test/test__log.mli b/lib/vcs_git_provider/test/test__log.mli similarity index 100% rename from lib/vcs_git_cli/test/test__log.mli rename to lib/vcs_git_provider/test/test__log.mli diff --git a/lib/vcs_git_cli/test/test__munged_path.ml b/lib/vcs_git_provider/test/test__munged_path.ml similarity index 93% rename from lib/vcs_git_cli/test/test__munged_path.ml rename to lib/vcs_git_provider/test/test__munged_path.ml index 3375e95..2401c11 100644 --- a/lib/vcs_git_cli/test/test__munged_path.ml +++ b/lib/vcs_git_provider/test/test__munged_path.ml @@ -19,14 +19,14 @@ (* and , respectively. *) (*******************************************************************************) -module Munged_path = Vcs_git_cli.Private.Munged_path +module Munged_path = Vcs_git_provider.Private.Munged_path let%expect_test "parse" = let test path = print_s [%sexp (Munged_path.parse_exn path : Munged_path.t)] in require_does_raise [%here] (fun () -> test ""); [%expect {| - (Vcs_git_cli.Munged_path.parse_exn + (Vcs_git_provider.Munged_path.parse_exn "invalid path" "" (Invalid_argument "\"\": invalid path")) @@ -34,7 +34,7 @@ let%expect_test "parse" = require_does_raise [%here] (fun () -> test "/tmp => /tmp"); [%expect {| - (Vcs_git_cli.Munged_path.parse_exn + (Vcs_git_provider.Munged_path.parse_exn "invalid path" "/tmp => /tmp" (Invalid_argument "\"/tmp\": not a relative path")) @@ -42,7 +42,7 @@ let%expect_test "parse" = require_does_raise [%here] (fun () -> test "tmp => tmp2 => tmp3"); [%expect {| - (Vcs_git_cli.Munged_path.parse_exn + (Vcs_git_provider.Munged_path.parse_exn "invalid path" "tmp => tmp2 => tmp3" "Too many '=>'") |}]; diff --git a/lib/vcs_git_cli/test/test__munged_path.mli b/lib/vcs_git_provider/test/test__munged_path.mli similarity index 100% rename from lib/vcs_git_cli/test/test__munged_path.mli rename to lib/vcs_git_provider/test/test__munged_path.mli diff --git a/lib/vcs_git_cli/test/test__name_status.ml b/lib/vcs_git_provider/test/test__name_status.ml similarity index 95% rename from lib/vcs_git_cli/test/test__name_status.ml rename to lib/vcs_git_provider/test/test__name_status.ml index 30d606c..35d3130 100644 --- a/lib/vcs_git_cli/test/test__name_status.ml +++ b/lib/vcs_git_provider/test/test__name_status.ml @@ -34,7 +34,7 @@ let%expect_test "parse_exn" = let path = Eio.Path.(Eio.Stdenv.fs env / "super-master-mind.name-status") in let contents = Eio.Path.load path in let lines = String.split_lines contents in - let name_status = Vcs_git_cli.Name_status.parse_lines_exn ~lines in + let name_status = Vcs_git_provider.Name_status.parse_lines_exn ~lines in print_s [%sexp (name_status : Vcs.Name_status.t)]; [%expect {| @@ -170,9 +170,11 @@ let%expect_test "Diff_status" = let entries = "ADMUQI?!XRCZ" in String.iter entries ~f:(fun char -> let diff_status = - Vcs_git_cli.Name_status.Diff_status.parse_exn (Printf.sprintf "%c something" char) + Vcs_git_provider.Name_status.Diff_status.parse_exn + (Printf.sprintf "%c something" char) in - print_s [%sexp (char : Char.t), (diff_status : Vcs_git_cli.Name_status.Diff_status.t)]); + print_s + [%sexp (char : Char.t), (diff_status : Vcs_git_provider.Name_status.Diff_status.t)]); [%expect {| (A A) @@ -187,7 +189,8 @@ let%expect_test "Diff_status" = (R R) (C C) (Z Not_supported) |}]; - require_does_raise [%here] (fun () -> Vcs_git_cli.Name_status.Diff_status.parse_exn ""); + require_does_raise [%here] (fun () -> + Vcs_git_provider.Name_status.Diff_status.parse_exn ""); [%expect {| "Unexpected empty diff status" |}]; () @@ -216,7 +219,7 @@ let%expect_test "parse_lines_exn" = in List.iter lines ~f:(fun line -> let result = - Or_error.try_with (fun () -> Vcs_git_cli.Name_status.parse_line_exn ~line) + Or_error.try_with (fun () -> Vcs_git_provider.Name_status.parse_line_exn ~line) in print_s [%sexp (line : string), (result : Vcs.Name_status.Change.t Or_error.t)]); [%expect diff --git a/lib/vcs_git_cli/test/test__name_status.mli b/lib/vcs_git_provider/test/test__name_status.mli similarity index 100% rename from lib/vcs_git_cli/test/test__name_status.mli rename to lib/vcs_git_provider/test/test__name_status.mli diff --git a/lib/vcs_git_cli/test/test__num_status.ml b/lib/vcs_git_provider/test/test__num_status.ml similarity index 98% rename from lib/vcs_git_cli/test/test__num_status.ml rename to lib/vcs_git_provider/test/test__num_status.ml index 102317d..e1cf640 100644 --- a/lib/vcs_git_cli/test/test__num_status.ml +++ b/lib/vcs_git_provider/test/test__num_status.ml @@ -27,7 +27,7 @@ let%expect_test "parse_exn - super-master-mind" = let path = Eio.Path.(Eio.Stdenv.fs env / "super-master-mind.num-status") in let contents = Eio.Path.load path in let lines = String.split_lines contents in - let num_status = Vcs_git_cli.Num_status.parse_lines_exn ~lines in + let num_status = Vcs_git_provider.Num_status.parse_lines_exn ~lines in print_s [%sexp (num_status : Vcs.Num_status.t)]; [%expect {| @@ -331,7 +331,7 @@ let%expect_test "parse_exn - eio" = let path = Eio.Path.(Eio.Stdenv.fs env / "eio.num-status") in let contents = Eio.Path.load path in let lines = String.split_lines contents in - let num_status = Vcs_git_cli.Num_status.parse_lines_exn ~lines in + let num_status = Vcs_git_provider.Num_status.parse_lines_exn ~lines in print_s [%sexp (num_status : Vcs.Num_status.t)]; [%expect {| @@ -472,7 +472,7 @@ let%expect_test "parse_lines_exn" = in List.iter lines ~f:(fun line -> let result = - Or_error.try_with (fun () -> Vcs_git_cli.Num_status.parse_line_exn ~line) + Or_error.try_with (fun () -> Vcs_git_provider.Num_status.parse_line_exn ~line) in print_s [%sexp (line : string), (result : Vcs.Num_status.Change.t Or_error.t)]); [%expect diff --git a/lib/vcs_git_cli/test/test__num_status.mli b/lib/vcs_git_provider/test/test__num_status.mli similarity index 100% rename from lib/vcs_git_cli/test/test__num_status.mli rename to lib/vcs_git_provider/test/test__num_status.mli diff --git a/lib/vcs_git_cli/test/test__refs.ml b/lib/vcs_git_provider/test/test__refs.ml similarity index 94% rename from lib/vcs_git_cli/test/test__refs.ml rename to lib/vcs_git_provider/test/test__refs.ml index 4ed5902..ba28e3c 100644 --- a/lib/vcs_git_cli/test/test__refs.ml +++ b/lib/vcs_git_provider/test/test__refs.ml @@ -33,7 +33,7 @@ let%expect_test "parse_exn" = let path = Eio.Path.(Eio.Stdenv.fs env / "super-master-mind.refs") in let contents = Eio.Path.load path in let lines = String.split_lines contents in - let refs = Vcs_git_cli.Refs.parse_lines_exn ~lines in + let refs = Vcs_git_provider.Refs.parse_lines_exn ~lines in print_s [%sexp { tags = (Vcs.Refs.tags refs : Set.M(Vcs.Tag_name).t) @@ -56,7 +56,7 @@ let%expect_test "parse_exn" = let%expect_test "parse_ref_kind_exn" = let test_ref_kind str = print_s - [%sexp (Vcs_git_cli.Refs.Dereferenced.parse_ref_kind_exn str : Vcs.Ref_kind.t)] + [%sexp (Vcs_git_provider.Refs.Dereferenced.parse_ref_kind_exn str : Vcs.Ref_kind.t)] in require_does_raise [%here] (fun () -> test_ref_kind "blah"); [%expect {| (Invalid_argument "String.chop_prefix_exn \"blah\" \"refs/\"") |}]; @@ -84,7 +84,8 @@ let%expect_test "dereferenced" = let test line = print_s [%sexp - (Vcs_git_cli.Refs.Dereferenced.parse_exn ~line : Vcs_git_cli.Refs.Dereferenced.t)] + (Vcs_git_provider.Refs.Dereferenced.parse_exn ~line + : Vcs_git_provider.Refs.Dereferenced.t)] in require_does_raise [%here] (fun () -> test ""); [%expect {| ("Invalid ref line" "") |}]; diff --git a/lib/vcs_git_cli/test/test__refs.mli b/lib/vcs_git_provider/test/test__refs.mli similarity index 100% rename from lib/vcs_git_cli/test/test__refs.mli rename to lib/vcs_git_provider/test/test__refs.mli diff --git a/lib/vcs_git_cli/test/test__show.ml b/lib/vcs_git_provider/test/test__show.ml similarity index 97% rename from lib/vcs_git_cli/test/test__show.ml rename to lib/vcs_git_provider/test/test__show.ml index 23c567f..9f810e2 100644 --- a/lib/vcs_git_cli/test/test__show.ml +++ b/lib/vcs_git_provider/test/test__show.ml @@ -23,7 +23,7 @@ let%expect_test "show" = let test output = print_s [%sexp - (Vcs_git_cli.Show.interpret_output output + (Vcs_git_provider.Show.interpret_output output : [ `Absent | `Present of Vcs.File_contents.t ] Or_error.t)] in test { exit_code = 0; stdout = "contents"; stderr = "" }; diff --git a/lib/vcs_git_cli/test/test__show.mli b/lib/vcs_git_provider/test/test__show.mli similarity index 100% rename from lib/vcs_git_cli/test/test__show.mli rename to lib/vcs_git_provider/test/test__show.mli diff --git a/vcs-git-blocking.opam b/vcs-git-blocking.opam index df7bfec..613954f 100644 --- a/vcs-git-blocking.opam +++ b/vcs-git-blocking.opam @@ -1,6 +1,7 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -synopsis: "A Git provider for Vcs based on Vcs_git_cli for blocking programs" +synopsis: + "A Git provider for Vcs based on Vcs_git_provider for blocking programs" maintainer: ["Mathieu Barbin"] authors: ["Mathieu Barbin"] license: "LGPL-3.0-or-later WITH LGPL-3.0-linking-exception" @@ -23,7 +24,7 @@ depends: [ "ppxlib" {>= "0.33"} "provider" {>= "0.0.8"} "vcs" {= version} - "vcs-git-cli" {= version} + "vcs-git-provider" {= version} "odoc" {with-doc} ] build: [ diff --git a/vcs-git-eio.opam b/vcs-git-eio.opam index ce50e8b..66fce8b 100644 --- a/vcs-git-eio.opam +++ b/vcs-git-eio.opam @@ -1,6 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -synopsis: "A Git provider for Vcs based on Vcs_git_cli for Eio programs" +synopsis: "A Git provider for Vcs based on Vcs_git_provider for Eio programs" maintainer: ["Mathieu Barbin"] authors: ["Mathieu Barbin"] license: "LGPL-3.0-or-later WITH LGPL-3.0-linking-exception" @@ -24,7 +24,7 @@ depends: [ "ppxlib" {>= "0.33"} "provider" {>= "0.0.8"} "vcs" {= version} - "vcs-git-cli" {= version} + "vcs-git-provider" {= version} "vcs-private-libs-eio" {= version} "odoc" {with-doc} ] diff --git a/vcs-git-cli.opam b/vcs-git-provider.opam similarity index 100% rename from vcs-git-cli.opam rename to vcs-git-provider.opam diff --git a/vcs-tests.opam b/vcs-tests.opam index 7a22671..b686df8 100644 --- a/vcs-tests.opam +++ b/vcs-tests.opam @@ -46,7 +46,7 @@ depends: [ "vcs-command" {= version} "vcs-git-eio" {= version} "vcs-git-blocking" {= version} - "vcs-git-cli" {= version} + "vcs-git-provider" {= version} "vcs-private-libs-base" {= version} "vcs-private-libs-eio" {= version} "vcs-test-helpers" {= version}