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

Add CLI options for setting the hash function #898

Merged
merged 7 commits into from
Nov 22, 2019

Conversation

craigfe
Copy link
Member

@craigfe craigfe commented Nov 22, 2019

Closes #896.

  • Adds new Make_BLAKE2X functors to Irmin.Hash (matching those in Digestif), which allow the user to set the bit-length of these hash functions. The original BLAKE2B and BLAKE2S modules have been kept as sensible defaults.

  • Add a --hash parameter to the irmin binary, allowing the hash function to be specified. For BLAKE2b and BLAKE2s, the bit-length may be specified with a trailing slash, as in --hash=blake2b/16. This behaviour is documented in the --help and manpages.

  • Generally improves the documentation produced by Cmdliner (e.g. by exposing the various store / content types as enum values).

TODO: add an error when attempting to set the hash function in combination with a Git-compatible backend (for which the hash function must be SHA1). At the moment, the hash parameter is simply ignored in these cases.

@craigfe craigfe requested a review from samoht November 22, 2019 17:10
@samoht
Copy link
Member

samoht commented Nov 22, 2019

That looks great! Do you want to implement the TODO before we merge that PR?

@craigfe
Copy link
Member Author

craigfe commented Nov 22, 2019

Now also contains a changes entry for #897.

@craigfe
Copy link
Member Author

craigfe commented Nov 22, 2019

That looks great! Do you want to implement the TODO before we merge that PR?

I have given a quick fix for the TODO in 1c6f7d1. Let me know what you think!

@samoht
Copy link
Member

samoht commented Nov 22, 2019

Looks great -- I'll merge once Travis is happy (as ocaml-ci seems stuck in time)

@samoht samoht merged commit 444e03e into mirage:master Nov 22, 2019
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.

irmin-pack: ensure that irmin -s pack work with tezos data
2 participants