feat(sys): experimental SHA256 OID support #1201
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this is for
Integrate upstream libgit2 experimental SHA256 support in
libgit2-sys, includingunstable-sha256, gating all new ABI/API changes. We don't offer any SemVer or stability for this feature, as it is subject to change in upstream.libgit2-syssystem lib probing also support discoveringlibgit2-experimental.soat best effort. Since-experimentallib is ABI-incompatible with a normal build, if you enableunstable-sha256, it won't probe ordinarylibgit2.so.systestto check SHA256 bindings.Note: there is no git2-rs high level API support in this PR
Part of #1090
Full list of API changes
Changes in constants
GIT_OID_SHA1_SIZEGIT_OID_SHA1_HEXSIZEGIT_OID_RAWSZ(whenusntable-sha256enabled)GIT_OID_HEXSZ(whenusntable-sha256enabled)GIT_OID_SHA256_SIZEGIT_OID_SHA256_HEXSIZEGIT_OID_MAX_SIZE(size varies onunstable-sha256feature)GIT_OID_MAX_HEXSIZE(size varies onunstable-sha256feature)GIT_INDEX_OPTIONS_INITGIT_INDEX_OPTIONS_VERSIONGIT_REPOSITORY_NEW_OPTIONS_INITGIT_REPOSITORY_NEW_OPTIONS_VERSIONGIT_ODB_OPTIONS_VERSIONGIT_ODB_BACKEND_PACK_OPTIONS_VERSIONGIT_ODB_BACKEND_LOOSE_OPTIONS_VERSIONGIT_DIFF_PARSE_OPTIONS_VERSIONChanges in structs
git_oid.typefieldgit_oid.idmax size is nowGIT_OID_MAX_SIZEgit_repository_init_options.oid_typefieldgit_index_optionsgit_repository_new_optionsgit_odb_optionsgit_odb_backend_pack_optionsgit_odb_backend_loose_optionsgit_diff_parse_optionsChanges in
GIT_EXTERNfunctions (need to expose)git_diff_from_bufferSHA256 supportgit_index_newSHA256 supportgit_index_openSHA256 supportgit_index_options_initSHA256 supportgit_indexer_newSHA256 supportgit_object_rawcontent_is_validfor both SHA1 and SHA256git_odb_backend_looseSHA256 supportgit_odb_backend_one_packSHA256 supportgit_odb_backend_packSHA256 supportgit_odb_hashSHA256 supportgit_odb_hashfileSHA256 supportgit_odb_newSHA256 supportgit_odb_openfor both SHA1 and SHA256git_repository_newint GIT_CALLBACK(oid_type)(git_oid_t *object_type, git_transport *transport)git_commit_graph_*not blocking the SHA256 experimentgit_midx_writer_*not blocking the SHA256 experimentChanges in
GIT_INLINEfunctions (no need to expose)git_oid_algorithmgit_oid_cleargit_oid_hexsizegit_oid_sizegit_oid_typegit_oid_type_fromstrgit_oid_type_fromstrngit_oid_type_is_validgit_oid_type_namegit_oid__cmpgit_oid__cpy_prefix