Skip to content

add progress reporting capability to fetch#405

Merged
dinosaure merged 1 commit intomirage:masterfrom
ulugbekna:fix-progress-reporting
Sep 28, 2020
Merged

add progress reporting capability to fetch#405
dinosaure merged 1 commit intomirage:masterfrom
ulugbekna:fix-progress-reporting

Conversation

@ulugbekna
Copy link
Copy Markdown
Contributor

@ulugbekna ulugbekna commented Sep 28, 2020

Adds progress reporting capability (as arguments) to fetch through all fetch "levels":

Nss.Fetch.fetch_v1 <- Smart_git.fetch <- Sync.fetch <- Git_unix/Mem.fetch

@dinosaure dinosaure merged commit 07fefa7 into mirage:master Sep 28, 2020
@dinosaure
Copy link
Copy Markdown
Member

Thanks!

@hannesm
Copy link
Copy Markdown
Member

hannesm commented Sep 28, 2020

I'm curious why pass through such callbacks, where logs is already used, and there could be a log source (enable/disable via the Logs library) to modify the output of log messages?

@dinosaure
Copy link
Copy Markdown
Member

I think this choice should be made by the end user - currently such outputs is printed by git and we should be able to do the same (and use something like Fmt.pr/Fmt.epr). Of course, in most of cases, the best is to report that with Logs.

@hannesm
Copy link
Copy Markdown
Member

hannesm commented Sep 28, 2020

I don't quite understand. My question is: why should there be two ways to receive output of the git library -- one using Logs (for debug / warnings / errors) -- the other passing through stdout and stderr arguments. To me, such a API design is quite confusing.

@dinosaure
Copy link
Copy Markdown
Member

dinosaure commented Sep 28, 2020

I don't quite understand. My question is: why should there be two ways to receive output of the git library -- one using Logs (for debug / warnings / errors) -- the other passing through stdout and stderr arguments. To me, such a API design is quite confusing.

Ah I think, you refer to the old implementation of ocaml-git which shows (with logs) these outputs. With the new version, I used ignore so, these outputs are neither printed out into logs nor printed out with Fmt.pr/Fmt.epr. This PR wants to expose the ability to choose something like Logs or Fmt.pr/Fmt.epr (into a binary such as ogit-fetch).

Currently, the default is ignore but it was not properly exposed to the {Git_unix,Mem}.Sync module. This PR wants to fix that 👍.

@hannesm
Copy link
Copy Markdown
Member

hannesm commented Sep 29, 2020

with this change, I get compilation errors in irmin-git (from @dinosaure's ocaml-git branch):

       Values do not match:
         val fetch :
           resolvers:'a ->
           'b -> 'c -> ?version:'d -> ?capabilities:'e -> 'f -> 'g
       is not included in
         val fetch :
           ?push_stdout:(string -> unit) ->
           ?push_stderr:(string -> unit) ->
           resolvers:Conduit.resolvers ->
           Smart_git.endpoint ->
           G.t ->
           ?version:[> `V1 ] ->
           ?capabilities:Smart.Capability.t list ->
           [ `All | `None | `Some of Git__.Reference.t list ] ->
           ((G.hash * (Git__.Reference.t * G.hash) list) option, error)
           result Lwt.t
       File "src/git/sync.mli", lines 27-36, characters 2-67:
         Expected declaration
       File "src/irmin-git/irmin_git.ml", line 1075, characters 6-11:
         Actual declaration

dinosaure added a commit to dinosaure/opam-repository that referenced this pull request Jan 9, 2021
… git-unix (3.0.0)

CHANGES:

- Rewrite of `ocaml-git` (@dinosaure, mirage/ocaml-git#395)
- Delete useless constraints on digestif's signature (@dinosaure, mirage/ocaml-git#399)
- Add support of CoHTTP with UNIX and MirageOS (@ulugbekna, mirage/ocaml-git#400)
- Add progress reporting on fetch command (@ulugbekna, mirage/ocaml-git#405)
- Lint dependencies on packages (`git-cohttp-unix` and `git-cohttp-mirage`)
  and update to the last version of CoHTTP (@hannesm, mirage/ocaml-git#407)
- Fix internal `Cstruct_append` implementation (@dinosaure, mirage/ocaml-git#401)
- Implement shallow commit (@dinosaure, mirage/ocaml-git#402)
- Update to `conduit.3.0.0` (@dinosaure, mirage/ocaml-git#408) (deleted by the integration of `mimic`)
- Delete use of `ocurl` (@dinosaure, mirage/ocaml-git#410)
- Delete the useless **old** `git-mirage` package (@hannesm, mirage/ocaml-git#411)
- Fix about unresolved endpoint with `conduit.3.0.0` (@dinosaure, mirage/ocaml-git#412)
- Refactors fetch command (@ulugbekna, mirage/ocaml-git#404)
- Fix ephemerons about temporary devices (@dinosaure, mirage/ocaml-git#413)
- Implementation of `ogit-fetch` as an example (@ulugbekna, mirage/ocaml-git#406)
- Rename `nss` to `git-nss` (@dinosaure, mirage/ocaml-git#415)
- Refactors `git-nss` (@ulugbekna, mirage/ocaml-git#416)
- Update README.md (@ulugbekna, mirage/ocaml-git#417)
- Replace deprecated `Fmt` functions (@ulugbekna, mirage/ocaml-git#421)
- Delete physical equality (@ulugbekna, mirage/ocaml-git#422)
- Rename `prelude` argument by `uses_git_transport` (@ulugbekna, mirage/ocaml-git#423)
- Refactors Smart decoder (@ulugbekna, mirage/ocaml-git#424)
- Constraint to use `fmt.0.8.7` (@dinosaure, mirage/ocaml-git#425)
- Small refactors in `git-nss` (@dinosaure, mirage/ocaml-git#427)
- Delete `conduit.3.0.0` and replace it by `mimic` (@dinosaure, mirage/ocaml-git#428)
- Delete the useless `verify` function on `fetch` and `push` (@dinosaure, mirage/ocaml-git#429)
- Delete `pin-depends` on `awa` (@dinosaure, mirage/ocaml-git#431)
dinosaure added a commit to dinosaure/opam-repository that referenced this pull request Jan 9, 2021
…t-unix and git-mirage (3.0.0)

CHANGES:

- Rewrite of `ocaml-git` (@dinosaure, mirage/ocaml-git#395)
- Delete useless constraints on digestif's signature (@dinosaure, mirage/ocaml-git#399)
- Add support of CoHTTP with UNIX and MirageOS (@ulugbekna, mirage/ocaml-git#400)
- Add progress reporting on fetch command (@ulugbekna, mirage/ocaml-git#405)
- Lint dependencies on packages (`git-cohttp-unix` and `git-cohttp-mirage`)
  and update to the last version of CoHTTP (@hannesm, mirage/ocaml-git#407)
- Fix internal `Cstruct_append` implementation (@dinosaure, mirage/ocaml-git#401)
- Implement shallow commit (@dinosaure, mirage/ocaml-git#402)
- Update to `conduit.3.0.0` (@dinosaure, mirage/ocaml-git#408) (deleted by the integration of `mimic`)
- Delete use of `ocurl` (@dinosaure, mirage/ocaml-git#410)
- Delete the useless **old** `git-mirage` package (@hannesm, mirage/ocaml-git#411)
- Fix about unresolved endpoint with `conduit.3.0.0` (@dinosaure, mirage/ocaml-git#412)
- Refactors fetch command (@ulugbekna, mirage/ocaml-git#404)
- Fix ephemerons about temporary devices (@dinosaure, mirage/ocaml-git#413)
- Implementation of `ogit-fetch` as an example (@ulugbekna, mirage/ocaml-git#406)
- Rename `nss` to `git-nss` (@dinosaure, mirage/ocaml-git#415)
- Refactors `git-nss` (@ulugbekna, mirage/ocaml-git#416)
- Update README.md (@ulugbekna, mirage/ocaml-git#417)
- Replace deprecated `Fmt` functions (@ulugbekna, mirage/ocaml-git#421)
- Delete physical equality (@ulugbekna, mirage/ocaml-git#422)
- Rename `prelude` argument by `uses_git_transport` (@ulugbekna, mirage/ocaml-git#423)
- Refactors Smart decoder (@ulugbekna, mirage/ocaml-git#424)
- Constraint to use `fmt.0.8.7` (@dinosaure, mirage/ocaml-git#425)
- Small refactors in `git-nss` (@dinosaure, mirage/ocaml-git#427)
- Delete `conduit.3.0.0` and replace it by `mimic` (@dinosaure, mirage/ocaml-git#428)
- Delete the useless `verify` function on `fetch` and `push` (@dinosaure, mirage/ocaml-git#429)
- Delete `pin-depends` on `awa` (@dinosaure, mirage/ocaml-git#431)
dinosaure added a commit to dinosaure/opam-repository that referenced this pull request Jan 9, 2021
…t-unix and git-mirage (3.0.0)

CHANGES:

- Rewrite of `ocaml-git` (@dinosaure, mirage/ocaml-git#395)
- Delete useless constraints on digestif's signature (@dinosaure, mirage/ocaml-git#399)
- Add support of CoHTTP with UNIX and MirageOS (@ulugbekna, mirage/ocaml-git#400)
- Add progress reporting on fetch command (@ulugbekna, mirage/ocaml-git#405)
- Lint dependencies on packages (`git-cohttp-unix` and `git-cohttp-mirage`)
  and update to the last version of CoHTTP (@hannesm, mirage/ocaml-git#407)
- Fix internal `Cstruct_append` implementation (@dinosaure, mirage/ocaml-git#401)
- Implement shallow commit (@dinosaure, mirage/ocaml-git#402)
- Update to `conduit.3.0.0` (@dinosaure, mirage/ocaml-git#408) (deleted by the integration of `mimic`)
- Delete use of `ocurl` (@dinosaure, mirage/ocaml-git#410)
- Delete the useless **old** `git-mirage` package (@hannesm, mirage/ocaml-git#411)
- Fix about unresolved endpoint with `conduit.3.0.0` (@dinosaure, mirage/ocaml-git#412)
- Refactors fetch command (@ulugbekna, mirage/ocaml-git#404)
- Fix ephemerons about temporary devices (@dinosaure, mirage/ocaml-git#413)
- Implementation of `ogit-fetch` as an example (@ulugbekna, mirage/ocaml-git#406)
- Rename `nss` to `git-nss` (@dinosaure, mirage/ocaml-git#415)
- Refactors `git-nss` (@ulugbekna, mirage/ocaml-git#416)
- Update README.md (@ulugbekna, mirage/ocaml-git#417)
- Replace deprecated `Fmt` functions (@ulugbekna, mirage/ocaml-git#421)
- Delete physical equality (@ulugbekna, mirage/ocaml-git#422)
- Rename `prelude` argument by `uses_git_transport` (@ulugbekna, mirage/ocaml-git#423)
- Refactors Smart decoder (@ulugbekna, mirage/ocaml-git#424)
- Constraint to use `fmt.0.8.7` (@dinosaure, mirage/ocaml-git#425)
- Small refactors in `git-nss` (@dinosaure, mirage/ocaml-git#427)
- Delete `conduit.3.0.0` and replace it by `mimic` (@dinosaure, mirage/ocaml-git#428)
- Delete the useless `verify` function on `fetch` and `push` (@dinosaure, mirage/ocaml-git#429)
- Delete `pin-depends` on `awa` (@dinosaure, mirage/ocaml-git#431)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants