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

use digestif hashes #310

Merged
merged 3 commits into from
Sep 7, 2018
Merged

use digestif hashes #310

merged 3 commits into from
Sep 7, 2018

Conversation

samoht
Copy link
Member

@samoht samoht commented Sep 5, 2018

Use Digestif.S instead of custom hash signature

The patch is too invasive to my taste, but I had to flatten a lot of the modules hiearchies to make everyting compile...

Copy link
Member

@dinosaure dinosaure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, a big PR about functor hell.

  • One other question is about Inflate and Deflate, it's really needed to keep them in interfaces?
  • If we need to provide Map.S and Set.S in digestif
  • Digestif.S.eq or Digestif.S.equal?

And then, an ocamlformat pass is really needed at the end.

src/git/pack.ml Outdated
module Hunk = Hunk(Hash)
module Pack = Pack(Hash)(Deflate)(Entry)(Delta)(Hunk)
module Stream (Hash: S.HASH) (Deflate: S.DEFLATE) = struct
module XEntry = Entry(Hash)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why X... ?

val feed_cstruct: ctx -> Cstruct.t -> ctx
val compare: t -> t -> int
val hash: t -> int
val equal: t -> t -> bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to choose between eq and equal but have both is not a good idea. I think equal should be the best and I can change API of Digestif.S to provide equal instead eq but we need to choose one - then if we choose equal, we need to update this PR to replace any H.eq to H.equal.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I think Digestif.S should provide equal instead of eq.

@samoht samoht force-pushed the hashes branch 2 times, most recently from 514b2d8 to ecd8886 Compare September 6, 2018 10:24
@samoht
Copy link
Member Author

samoht commented Sep 6, 2018

Rebased and fixed to take the comments into account.

The patch is too invasive to my taste, but I had to flatten a lot of the modules
hiearchies to make everyting compile...
@samoht
Copy link
Member Author

samoht commented Sep 6, 2018

Odd constraints on windows:


The following dependencies couldn't be met:
  - git-mirage -> git -> digestif >= 0.7.0 -> eqaf -> core_bench -> comparelib >= 109.27.00 -> type_conv < 112.02.00
  - git-mirage -> git -> digestif >= 0.7.0 -> eqaf -> core_bench -> core < v0.10
  - git-mirage -> git -> digestif >= 0.7.0 -> eqaf -> core_bench -> fieldslib = 109.20.00
  - git-mirage -> git -> digestif >= 0.7.0 -> eqaf -> core_bench -> sexplib < 113.25.00
  - git-mirage -> git -> digestif >= 0.7.0 -> eqaf -> core_bench -> textutils >= 112.17.00 -> sexplib < 113.25.00
  - git-mirage -> git -> digestif >= 0.7.0 -> eqaf -> core_bench -> textutils >= 112.17.00 -> core < v0.10

@dinosaure dinosaure mentioned this pull request Sep 6, 2018
@samoht
Copy link
Member Author

samoht commented Sep 7, 2018

The windows issues should be fixed by ocaml/opam-repository#12575

@samoht samoht merged commit 841039f into mirage:master Sep 7, 2018
@samoht samoht deleted the hashes branch September 7, 2018 11:43
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.

None yet

2 participants