-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from mbarbin/init-base-refactor
Initialize vcs-base refactor
- Loading branch information
Showing
196 changed files
with
5,123 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Vcs_base | ||
|
||
In this file we document a multi-stages refactoring that is currently in progress in the repository. | ||
|
||
## Targeted end result | ||
|
||
The aim of this refactoring is to remove the base dependency of the `Vcs` library. To achieve this, we will offer two distinct libraries: | ||
|
||
- `Vcs` - a kernel library that can be used with very little dependencies; | ||
- `Vcs_base` - an extension of `Vcs` which will add some functionality related to working with `Base`. | ||
|
||
## Stages | ||
|
||
### Stage 1 - Introducing `Vcs_base` | ||
|
||
- [x] Completed: Oct. 2024 | ||
|
||
In this stage, we create the library `Vcs_base` and setup the way in which this library extends `Vcs`. It exposes the same modules, plus extra functionality, such as: | ||
|
||
- Base style `hash` signatures | ||
- `Comparable.S` signatures for use with Base style containers | ||
- Make some functions return sets instead of lists. | ||
|
||
### Stage 2 - Reducing ppx dependencies in `Vcs` | ||
|
||
- [x] Completed: Oct. 2024 | ||
|
||
Only keep sexp related ppx that have no runtime dependency on `base`, such as `sexplib0` only. | ||
|
||
- Remove `ppx_compare`, `ppx_here`, `ppx_let` dependencies. | ||
|
||
### Stage 3 - Refactor non-raising APIs | ||
|
||
- [ ] Pending | ||
|
||
- Rename `Result` => `Rresult`, introduce a new `Result` one. | ||
|
||
### Stage 4 - Trait implementation use `Result` | ||
|
||
- [ ] Pending | ||
|
||
### Stage 5 - Move `Or_error` module into `Vcs_base`. | ||
|
||
- [ ] Pending | ||
|
||
### Stage 6 - Remove base dependency from `Vcs` | ||
|
||
- [ ] Pending | ||
|
||
Use `vcs/src/import` to make a local mini-stdlib with utils required to remove `base` dependency. | ||
|
||
Do this for the other libraries: | ||
|
||
- [ ] vcs | ||
- [ ] vcs_git_eio | ||
- [ ] vcs_git_provider | ||
- [ ] vcs_git_blocking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,9 @@ | |
For example: [Author.v "John Doe <[email protected]>"]. *) | ||
|
||
type t [@@deriving compare, equal, hash, sexp_of] | ||
type t | ||
|
||
include Container_key.S with type t := t | ||
include Validated_string.S with type t := t | ||
|
||
val of_user_config : user_name:User_name.t -> user_email:User_email.t -> t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
(*******************************************************************************) | ||
(* Vcs - a Versatile OCaml Library for Git Operations *) | ||
(* Copyright (C) 2024 Mathieu Barbin <[email protected]> *) | ||
(* *) | ||
(* This file is part of Vcs. *) | ||
(* *) | ||
(* Vcs is free software; you can redistribute it and/or modify it under *) | ||
(* the terms of the GNU Lesser General Public License as published by the *) | ||
(* Free Software Foundation either version 3 of the License, or any later *) | ||
(* version, with the LGPL-3.0 Linking Exception. *) | ||
(* *) | ||
(* Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) | ||
(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) | ||
(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) | ||
(* the file `NOTICE.md` at the root of this repository for more details. *) | ||
(* *) | ||
(* You should have received a copy of the GNU Lesser General Public License *) | ||
(* and the LGPL-3.0 Linking Exception along with this library. If not, see *) | ||
(* <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively. *) | ||
(*******************************************************************************) | ||
|
||
open! Import | ||
|
||
module type S = sig | ||
type t | ||
|
||
val compare : t -> t -> int | ||
val equal : t -> t -> bool | ||
val hash : t -> int | ||
val seeded_hash : int -> t -> int | ||
val sexp_of_t : t -> Sexp.t | ||
end | ||
|
||
module String_impl = struct | ||
type t = string | ||
|
||
let compare = compare_string | ||
let equal = equal_string | ||
let hash = hash_string | ||
let seeded_hash = Stdlib.String.seeded_hash | ||
let sexp_of_t = sexp_of_string | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(*_******************************************************************************) | ||
(*_ Vcs - a Versatile OCaml Library for Git Operations *) | ||
(*_ Copyright (C) 2024 Mathieu Barbin <[email protected]> *) | ||
(*_ *) | ||
(*_ This file is part of Vcs. *) | ||
(*_ *) | ||
(*_ Vcs is free software; you can redistribute it and/or modify it under *) | ||
(*_ the terms of the GNU Lesser General Public License as published by the *) | ||
(*_ Free Software Foundation either version 3 of the License, or any later *) | ||
(*_ version, with the LGPL-3.0 Linking Exception. *) | ||
(*_ *) | ||
(*_ Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) | ||
(*_ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) | ||
(*_ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) | ||
(*_ the file `NOTICE.md` at the root of this repository for more details. *) | ||
(*_ *) | ||
(*_ You should have received a copy of the GNU Lesser General Public License *) | ||
(*_ and the LGPL-3.0 Linking Exception along with this library. If not, see *) | ||
(*_ <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively. *) | ||
(*_******************************************************************************) | ||
|
||
module type S = sig | ||
type t | ||
|
||
val compare : t -> t -> int | ||
val equal : t -> t -> bool | ||
val hash : t -> int | ||
val seeded_hash : int -> t -> int | ||
val sexp_of_t : t -> Sexp.t | ||
end | ||
|
||
module String_impl : S with type t = string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,16 +20,8 @@ | |
(*******************************************************************************) | ||
|
||
let init vcs ~path = | ||
let open Or_error.Let_syntax in | ||
let%bind repo_root = Vcs_or_error.init vcs ~path in | ||
let%bind () = | ||
Vcs_or_error.set_user_name vcs ~repo_root ~user_name:(User_name.v "Test User") | ||
in | ||
let%bind () = | ||
Vcs_or_error.set_user_email | ||
vcs | ||
~repo_root | ||
~user_email:(User_email.v "[email protected]") | ||
in | ||
return repo_root | ||
let repo_root = Vcs0.init vcs ~path in | ||
Vcs0.set_user_name vcs ~repo_root ~user_name:(User_name.v "Test User"); | ||
Vcs0.set_user_email vcs ~repo_root ~user_email:(User_email.v "[email protected]"); | ||
repo_root | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.