From 10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:41:41 +0200 Subject: Merging upstream version 1.70.0+dfsg2. Signed-off-by: Daniel Baumann --- vendor/gix-hash/.cargo-checksum.json | 1 + vendor/gix-hash/CHANGELOG.md | 661 +++++++++++++++++++++++++++++++++++ vendor/gix-hash/Cargo.toml | 57 +++ vendor/gix-hash/src/kind.rs | 122 +++++++ vendor/gix-hash/src/lib.rs | 42 +++ vendor/gix-hash/src/object_id.rs | 229 ++++++++++++ vendor/gix-hash/src/oid.rs | 257 ++++++++++++++ vendor/gix-hash/src/prefix.rs | 152 ++++++++ 8 files changed, 1521 insertions(+) create mode 100644 vendor/gix-hash/.cargo-checksum.json create mode 100644 vendor/gix-hash/CHANGELOG.md create mode 100644 vendor/gix-hash/Cargo.toml create mode 100644 vendor/gix-hash/src/kind.rs create mode 100644 vendor/gix-hash/src/lib.rs create mode 100644 vendor/gix-hash/src/object_id.rs create mode 100644 vendor/gix-hash/src/oid.rs create mode 100644 vendor/gix-hash/src/prefix.rs (limited to 'vendor/gix-hash') diff --git a/vendor/gix-hash/.cargo-checksum.json b/vendor/gix-hash/.cargo-checksum.json new file mode 100644 index 000000000..9ffe10168 --- /dev/null +++ b/vendor/gix-hash/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"cfa2720468bb9d312e8825d791a256100f22bd3de177a9aaeecd35731e9c4c97","Cargo.toml":"e9d50d35d235a9a124af8044b46da5c5184e21b5386e39f0c8c565ceb54125f8","src/kind.rs":"449e1f3f6fb899bbba09b56b9ff0ddee61f47b8876c3a292df7126f0ac9d6981","src/lib.rs":"2c3c51085ab7e1ab6e8fabe73c350bacb0db0544532470a657781d0f1be981cb","src/object_id.rs":"17acfa8a5a0d7e44e5a0153653be152e0e6ef61ceadd553ff0f0016ecca8de4e","src/oid.rs":"fdc93e212423e85209694e4764419b1850e618491a47d68b6159566d90afd372","src/prefix.rs":"5bf4e3dfc605569280054983c28d501a585ce04b6948babffea24e14925d526f"},"package":"0c0c5a9f4d621d4f4ea046bb331df5c746ca735b8cae5b234cc2be70ee4dbef0"} \ No newline at end of file diff --git a/vendor/gix-hash/CHANGELOG.md b/vendor/gix-hash/CHANGELOG.md new file mode 100644 index 000000000..8cc493726 --- /dev/null +++ b/vendor/gix-hash/CHANGELOG.md @@ -0,0 +1,661 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## 0.10.3 (2023-02-20) + +### New Features + + - add `ObjectId::empty_blob()` to obtain the empty blob object. + +### Bug Fixes + + - note that crates have been renamed from `git-*` to `gix-*`. + This also means that the `git-*` prefixed crates of the `gitoxide` project + are effectively unmaintained. + Use the crates with the `gix-*` prefix instead. + + If you were using `git-repository`, then `gix` is its substitute. + +### Commit Statistics + + + + - 3 commits contributed to the release over the course of 1 calendar day. + - 3 days passed between releases. + - 1 commit was understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - Merge branch 'empty-blob' ([`796f298`](https://github.com/Byron/gitoxide/commit/796f2982ebc0b7682d0ee8987221fd3397e631aa)) + - refactor ([`231b268`](https://github.com/Byron/gitoxide/commit/231b268964c8e066aa58132978068be7c50b6d63)) + - add `ObjectId::empty_blob()` to obtain the empty blob object. ([`c817626`](https://github.com/Byron/gitoxide/commit/c817626a501dd3c8edd444c6e31ba04d9da31776)) +
+ +## 0.10.2 (2023-02-17) + + + + + +### Refactor (BREAKING) + + - rename `oid::short_hex()` to `oid::to_hex()` + +### New Features (BREAKING) + + - upgrade edition to 2021 in most crates. + MSRV for this is 1.56, and we are now at 1.60 so should be compatible. + This isn't more than a patch release as it should break nobody + who is adhering to the MSRV, but let's be careful and mark it + breaking. + + Note that `git-features` and `git-pack` are still on edition 2018 + as they make use of a workaround to support (safe) mutable access + to non-overlapping entries in a slice which doesn't work anymore + in edition 2021. + - break delete me + +### Changed (BREAKING) + + + + + + + + - rename `oid::try_from()` to `try_from_bytes()`, add `from_bytes_unchecked()` + This change was done in the name of consistency, as `from_bytes()` is + used in many other git-* crates + - Remove `Kind:Efrom_len_in_bytes()` from public API + It shouldn't be encouraged to assume the hash can be deduced from its + length, also git doesn't assume this. + + If that would happen, we would have other problems though, so let's hope + it doesn't happen nonetheless. + - Remove `ObjectId::null_sha1()` from public API + Use `Kind::Sha1.null()` instead if it's a value where the actual + repository object hash doesn't matter. + - rename `Kind::null()` to `null_ref()` and `Kind::null_owned()` to `null()` + This naming is consistent with typical Rust APIs and the naming used + throughout the git-* crates thus far. + - remove `Kind::new_sha1()` from public API + - Kind::from_len_in_bytes() is infallible + - remove `ObjectId::from_20_bytes()` from public API + Use `ObjectId::from()` or `ObjectId::try_from()` instead. + - remove various SHA1 specific hex utilities in favor of unspecific new ones + - removed `to_sha1_hex()`, use `oid::hex_to_buf()` and + `oid::hex_to_buf()` instead. +- remove `ObjectId::write_hex_to()` in favor of `oid::write_hex_to()` + +### Refactor + + - replace `quickerror` with `thiserror` + +### Bug Fixes + + - don't assume hex-only characters in `ObjectId::from_hex(…)`. + - don't use panicking const fn just yet to not require rust 1.57 + +### New Features + + - use docsrs feature in code to show what is feature-gated automatically on docs.rs + - pass --cfg docsrs when compiling for https://docs.rs + - `Prefix::from(ObjectId)` + This conversion will never fail and is useful as fallback to handle + failed hash shortenings, which can now default to a prefix that + represents the original and thus unique hash. + - expose `Prefix::MIN_HEX_LEN`. + That way other crates can know which candidates to discard off the bat + instead of having to match on an error. It's mere convenience. + - `Prefix::from_hex()` + - Implement `TryFrom<&str>` for `Prefix` + Currently there is no easy way to create a `struct Prefix` from a hex + string. The method `Parser::from_hex()` is NIY. + - `Commit::short_id()` + - git-hash::Prefix::from_id() + A way to obtain a prefix of an object id, with all non-prefix + bytes set to zero. + - Implement Display for hash kind + This helps 'clap' and allows for a little more type-safety during + declaration. + - Assign version numbers to `Kind` and implement `TryFrom` + This makes reading and writing the hash number easier for newer file + formats. + - add `Kind::from_len_in_bytes()` const fn + - `Kind::len_in_bytes()` method + It yields the amount of bytes needed to store the hash. + - oid::short_hex(len) for truncated hex representations + +### Chore + + - uniformize deny attributes + +### Documentation + + - fix typos + +### Commit Statistics + + + + - 237 commits contributed to the release over the course of 793 calendar days. + - 34 commits were understood as [conventional](https://www.conventionalcommits.org). + - 16 unique issues were worked on: [#198](https://github.com/Byron/gitoxide/issues/198), [#222](https://github.com/Byron/gitoxide/issues/222), [#279](https://github.com/Byron/gitoxide/issues/279), [#287](https://github.com/Byron/gitoxide/issues/287), [#293](https://github.com/Byron/gitoxide/issues/293), [#298](https://github.com/Byron/gitoxide/issues/298), [#301](https://github.com/Byron/gitoxide/issues/301), [#329](https://github.com/Byron/gitoxide/issues/329), [#331](https://github.com/Byron/gitoxide/issues/331), [#413](https://github.com/Byron/gitoxide/issues/413), [#427](https://github.com/Byron/gitoxide/issues/427), [#450](https://github.com/Byron/gitoxide/issues/450), [#470](https://github.com/Byron/gitoxide/issues/470), [#522](https://github.com/Byron/gitoxide/issues/522), [#63](https://github.com/Byron/gitoxide/issues/63), [#691](https://github.com/Byron/gitoxide/issues/691) + +### Thanks Clippy + + + +[Clippy](https://github.com/rust-lang/rust-clippy) helped 6 times to make code idiomatic. + +### Commit Details + + + +
view details + + * **[#198](https://github.com/Byron/gitoxide/issues/198)** + - Fix stop-release-for-changelog logic and fix all affected changelogs ([`52b38bc`](https://github.com/Byron/gitoxide/commit/52b38bc4856be5ba8b5372a3dd20f5d06504e7ed)) + - deduplicate conventional message ids ([`e695eda`](https://github.com/Byron/gitoxide/commit/e695eda8cd183f703d9a3e59b7c3c7fa496ea1d2)) + - regenerate all changelogs to get links ([`0c81769`](https://github.com/Byron/gitoxide/commit/0c817690bd444f52bed2936b2b451cafd87dde92)) + - format links for commit ids ([`9426db5`](https://github.com/Byron/gitoxide/commit/9426db53537162d58a65648f3f3a3a3b65f621dc)) + - Mention actual issues that where worked on ([`a517e39`](https://github.com/Byron/gitoxide/commit/a517e39a81145b331f6c7a6cc2fc22e25daf42e2)) + - Allow 'refactor' and 'other' in conventional messages if they have breaking changes ([`4eebaac`](https://github.com/Byron/gitoxide/commit/4eebaac669e590beed112b622752997c64772ef1)) + - Rebuild all changelogs to assure properly ordered headlines ([`4a9a05f`](https://github.com/Byron/gitoxide/commit/4a9a05f95930bad5938d4ce9c517ebf0e0b990f1)) + - Sort all commits by time, descending… ([`f536bad`](https://github.com/Byron/gitoxide/commit/f536bad20ffbac4dc353dfeb1a917bb88becbb78)) + - greatly reduce changelog size now that the traversal fix is applied ([`a0bc98c`](https://github.com/Byron/gitoxide/commit/a0bc98c06c349de2fd6e0d4593606e68b98def72)) + - rename `oid::short_hex()` to `oid::to_hex()` ([`8be4036`](https://github.com/Byron/gitoxide/commit/8be4036dce4a857cc14a8b9467aaf2fc0fc2e827)) + - Fixup remaining changelogs… ([`2f75db2`](https://github.com/Byron/gitoxide/commit/2f75db294fcf20c325555822f65629611be52971)) + - Generate changelogs with details ([`e1861ca`](https://github.com/Byron/gitoxide/commit/e1861caa435d312953a9fea7ceff6d2e07b03443)) + - oid::short_hex(len) for truncated hex representations ([`ed16bce`](https://github.com/Byron/gitoxide/commit/ed16bce97c235e7e188444afd7a0d3f7e04a6c72)) + * **[#222](https://github.com/Byron/gitoxide/issues/222)** + - update changelogs prior to release ([`9a493d0`](https://github.com/Byron/gitoxide/commit/9a493d0651b0b6d71cf230dc510a658be7f8cb19)) + - stabilize changelogs ([`920e832`](https://github.com/Byron/gitoxide/commit/920e83219911df1c440d3fe42fd5ec3a295b0bb8)) + - Update changelogs prior to release ([`b3e2252`](https://github.com/Byron/gitoxide/commit/b3e2252f7461a003d9a4612da60ba931dd8c0bef)) + * **[#279](https://github.com/Byron/gitoxide/issues/279)** + - Basic multi-pack index creation ([`89428b2`](https://github.com/Byron/gitoxide/commit/89428b2936fb0169606a543cf531bddaacb8187c)) + - multi-pack index writing complete with large-offset support ([`f7d5c7f`](https://github.com/Byron/gitoxide/commit/f7d5c7f815dbf52c668444b316ae2e1485463bcb)) + - Assign version numbers to `Kind` and implement `TryFrom` ([`84e26a7`](https://github.com/Byron/gitoxide/commit/84e26a7f3cbae31210e100880a48d3b3e6d04013)) + - rename `oid::try_from()` to `try_from_bytes()`, add `from_bytes_unchecked()` ([`79dc0d5`](https://github.com/Byron/gitoxide/commit/79dc0d5ba6fa31ddd5c075693ffdc6496c1eaded)) + - Remove `Kind:Efrom_len_in_bytes()` from public API ([`1b75541`](https://github.com/Byron/gitoxide/commit/1b75541c00b8a18000336a8a7eceae5beba1058d)) + - Remove `ObjectId::null_sha1()` from public API ([`b12ee8a`](https://github.com/Byron/gitoxide/commit/b12ee8a97904e6e90b6c08ad9e6804ee969bff41)) + - rename `Kind::null()` to `null_ref()` and `Kind::null_owned()` to `null()` ([`eaf48bd`](https://github.com/Byron/gitoxide/commit/eaf48bd75a3b778e31695257aedfbd008769f7bb)) + - remove `Kind::new_sha1()` from public API ([`60a4eb5`](https://github.com/Byron/gitoxide/commit/60a4eb5dd7f50949799c558a225146d442dcf936)) + - Kind::from_len_in_bytes() is infallible ([`c079fbe`](https://github.com/Byron/gitoxide/commit/c079fbe2099bd0ba43e811e987a80ae14e15e131)) + - refactor ([`7331e99`](https://github.com/Byron/gitoxide/commit/7331e99cb88df19f7b1e04b1468584e9c7c79913)) + - remove `ObjectId::from_20_bytes()` from public API ([`2a799e6`](https://github.com/Byron/gitoxide/commit/2a799e662aa172c243b54d1df0dfc78501cb024f)) + - fix docs ([`cd981e2`](https://github.com/Byron/gitoxide/commit/cd981e222af237c47fcfb74258de8fdfc04dfc1b)) + - remove various SHA1 specific hex utilities in favor of unspecific new ones ([`53c748d`](https://github.com/Byron/gitoxide/commit/53c748d7f438f57e8119cdf04402bfeaa9f2a286)) + - `oid::null_sha1()` replaced with `Kind::null()` ([`67652cb`](https://github.com/Byron/gitoxide/commit/67652cb5cf01c45291d6e117c31290c585bab9d1)) + - remove `ObjectId::from_borrowed_sha1()` ([`3363f1e`](https://github.com/Byron/gitoxide/commit/3363f1e61295810964ddb0c255eed87a87fe6539)) + - remove `ObjectId::to_sha1_hex_string()` ([`75b901e`](https://github.com/Byron/gitoxide/commit/75b901eff177dade43a28e770920a2b2206ded69)) + - SIZE_OF_SHA1_DIGEST is now private ([`b596fa0`](https://github.com/Byron/gitoxide/commit/b596fa0dbbb3cc1d3ac386458ef52e2db9bca55c)) + - rename `Kind::to_hex()` to `Kind::to_hex_with_len()`; add `Kind::to_hex()` ([`3373946`](https://github.com/Byron/gitoxide/commit/3373946d27c91169172e62a637a305ef1e5fbb9e)) + - add `Kind::from_len_in_bytes()` const fn ([`ce673bf`](https://github.com/Byron/gitoxide/commit/ce673bfd9afee4a7872c6bcae1c39006b1747be7)) + - `Kind::len_in_bytes()` method ([`9a0d8b8`](https://github.com/Byron/gitoxide/commit/9a0d8b810050f2acabca988c5ab24ebe93a5d260)) + * **[#287](https://github.com/Byron/gitoxide/issues/287)** + - Very rough version of repository verification ([`80a4a7a`](https://github.com/Byron/gitoxide/commit/80a4a7add688d16376b9bf2ed7f1c7f655b7c912)) + * **[#293](https://github.com/Byron/gitoxide/issues/293)** + - prepare changelogs for git-index and dependencies ([`f54bf4b`](https://github.com/Byron/gitoxide/commit/f54bf4bde92b892b6d425987a6a37e10319c4635)) + * **[#298](https://github.com/Byron/gitoxide/issues/298)** + - docs ([`a45f378`](https://github.com/Byron/gitoxide/commit/a45f3789696078848e2e96ddb8a55570c941dd53)) + - Implement ODB::disambiguate_prefix(…) ([`7d4d281`](https://github.com/Byron/gitoxide/commit/7d4d2818395cfe0c31117f8736471d4a707e3feb)) + - support MSRV ([`d09fd9b`](https://github.com/Byron/gitoxide/commit/d09fd9b37557f2dc199e8a4651c56b3b63423136)) + - add documentation for lookup_prefix along with missing test ([`927b2ac`](https://github.com/Byron/gitoxide/commit/927b2ace875cdda63ce312eb7ad5329f2159608d)) + - lookup_prefix() seems to work now ([`b558f11`](https://github.com/Byron/gitoxide/commit/b558f111520381e25a9500d3b2401fdd337db6f6)) + - A stab at implementing lookup_prefix - to no avail ([`69cb6d1`](https://github.com/Byron/gitoxide/commit/69cb6d1dd6b8df74fee1ead1ce15bcf0b51d7232)) + - refactor ([`cff6f9f`](https://github.com/Byron/gitoxide/commit/cff6f9fc90e58c409e367912d0b38860fae9a205)) + - refactor ([`5bc548e`](https://github.com/Byron/gitoxide/commit/5bc548ed500045491012ab0a93bcbe13e78b0dc8)) + - Prefix now validates all constraints and errors on violation ([`75efa79`](https://github.com/Byron/gitoxide/commit/75efa79f62efc29b343d2d2f53eaf001eef176df)) + - refactor; add docs ([`837db62`](https://github.com/Byron/gitoxide/commit/837db626b88b08567c059f9f6687ad3124117ed3)) + - git-hash::Prefix::from_id() ([`cb83bee`](https://github.com/Byron/gitoxide/commit/cb83beedd1aa389f6774e2296f79273e8c8f14f4)) + - Implement Display for hash kind ([`bc89fc7`](https://github.com/Byron/gitoxide/commit/bc89fc77354f7d8af6628364be18550c4a45c789)) + * **[#301](https://github.com/Byron/gitoxide/issues/301)** + - update changelogs prior to release ([`84cb256`](https://github.com/Byron/gitoxide/commit/84cb25614a5fcddff297c1713eba4efbb6ff1596)) + - `Commit::short_id()` ([`1be00cf`](https://github.com/Byron/gitoxide/commit/1be00cf9e00ce9428ffddb2c79b2373926069b13)) + * **[#329](https://github.com/Byron/gitoxide/issues/329)** + - Document all features related to serde1 ([`72b97f2`](https://github.com/Byron/gitoxide/commit/72b97f2ae4dc7642b160f183c6d5df4502dc186f)) + * **[#331](https://github.com/Byron/gitoxide/issues/331)** + - Update changelog prior to release ([`1d07934`](https://github.com/Byron/gitoxide/commit/1d079346e789b0acc9a4bdf7577b21c1c37b6106)) + * **[#413](https://github.com/Byron/gitoxide/issues/413)** + - Don't hardcode Sha1 ([`521c894`](https://github.com/Byron/gitoxide/commit/521c894faf8b1875f449c04aa87003066d4c04ff)) + - refactor ([`85b9f13`](https://github.com/Byron/gitoxide/commit/85b9f13eb29359a34597fb615805d0fa5aac075b)) + - refactor ([`073d3a1`](https://github.com/Byron/gitoxide/commit/073d3a104725b06279dbfca6d1a35531fa9cb5c5)) + - `Prefix::from_hex()` ([`535411f`](https://github.com/Byron/gitoxide/commit/535411f94dcab7e7d9cab6324ac30a4c70298bb2)) + * **[#427](https://github.com/Byron/gitoxide/issues/427)** + - `Prefix::from(ObjectId)` ([`0579438`](https://github.com/Byron/gitoxide/commit/05794383cb7c903ab30b5d6ef0178dffdf66feee)) + - expose `Prefix::MIN_HEX_LEN`. ([`652f228`](https://github.com/Byron/gitoxide/commit/652f228bb7ec880856d4e6ee1c171b0b85a735e2)) + * **[#450](https://github.com/Byron/gitoxide/issues/450)** + - refactor ([`93ac4c3`](https://github.com/Byron/gitoxide/commit/93ac4c38e5837250e158613820a6ac1bb7119ba0)) + * **[#470](https://github.com/Byron/gitoxide/issues/470)** + - update changelogs prior to release ([`caa7a1b`](https://github.com/Byron/gitoxide/commit/caa7a1bdef74d7d3166a7e38127a59f5ab3cfbdd)) + * **[#522](https://github.com/Byron/gitoxide/issues/522)** + - don't assume hex-only characters in `ObjectId::from_hex(…)`. ([`aaed7ea`](https://github.com/Byron/gitoxide/commit/aaed7eaf4887d5e499437d45c8284bc8941da2ac)) + - refactor ([`f3bcddf`](https://github.com/Byron/gitoxide/commit/f3bcddff931e50472e7a3e8c2c60f3cd565bfa56)) + - refactor ([`0f0de2b`](https://github.com/Byron/gitoxide/commit/0f0de2ba7837e2044e22a16b6d5e20b3137e9691)) + * **[#63](https://github.com/Byron/gitoxide/issues/63)** + - Revert "Add additional variant for Sha256 in ObjectId" ([`bb24dc4`](https://github.com/Byron/gitoxide/commit/bb24dc44beb6354fe2d96d2318d4d3219f06ae85)) + - Add additional variant for Sha256 in ObjectId ([`3dd7c43`](https://github.com/Byron/gitoxide/commit/3dd7c4350e140b72c21598f95a4557e6115d3124)) + - Make ObjectId into an enum to soon hold more bytes (and type) ([`4bf0c1a`](https://github.com/Byron/gitoxide/commit/4bf0c1a5a5c23bb0c0836ab8cea41eb06a232906)) + - Impl == and != for common combinations of ObjectId/oid ([`2455178`](https://github.com/Byron/gitoxide/commit/24551781cee4fcf312567ca9270d54a95bc4d7ae)) + - Remove now unused gith-hash::borrowed::Id ([`59ab1bd`](https://github.com/Byron/gitoxide/commit/59ab1bd9a8ea57e1770caf8841a0af5d38905bec)) + - More general to-hex for ObjectId ([`e2be868`](https://github.com/Byron/gitoxide/commit/e2be868ad4a131682d4aae629ca5b3a5b7ed0d5f)) + - Fix incorrectly implemented display for `oid` ([`c4186b0`](https://github.com/Byron/gitoxide/commit/c4186b0a986b4b49f8aa70308b492063bd33285c)) + - git-commitgraph uses `oid` now ([`0b72966`](https://github.com/Byron/gitoxide/commit/0b72966249523b97fce1bc7b29082ac68fa86a4f)) + - Notes about future proofing `oid` type… ([`658c896`](https://github.com/Byron/gitoxide/commit/658c896690f9a5b63f08484e90837bd1338420a5)) + - Use new `oid` where possible in git-odb ([`68a709e`](https://github.com/Byron/gitoxide/commit/68a709e0337d4969138d30a5c25d60b7dbe51a73)) + - oid with even more conversions and better hex-display ([`eecd664`](https://github.com/Byron/gitoxide/commit/eecd6644b10ba1e2e8481287db85c67ea6268674)) + - refactor; better errors for invalid hash sizes ([`be84b36`](https://github.com/Byron/gitoxide/commit/be84b36129694a2e89d1b81d932f2eba23aedf54)) + - Add quality-of-life parse() support for hex input ([`6f97063`](https://github.com/Byron/gitoxide/commit/6f97063b14eb3b38a36e418657fd50f80db7f905)) + - Make ObjectId/oid happen! ([`ca78d15`](https://github.com/Byron/gitoxide/commit/ca78d15373ec988d909be8f240baefe75555e077)) + - A seemingly complete implementation of a referenced borrowed Id ([`b3fc365`](https://github.com/Byron/gitoxide/commit/b3fc36565157a7f9d2fc9cf1a3c009a20c66e661)) + - Fix doc string naming ([`59c3d45`](https://github.com/Byron/gitoxide/commit/59c3d454b61e6932aee0fce0f709ac214db08633)) + - Move git-hash::owned::Id into git-hash::Id ([`fdbe704`](https://github.com/Byron/gitoxide/commit/fdbe704b6c9ace2b8f629f681a0580b24749a238)) + - Make git-hash Error usage explicit (it's for decoding only) ([`4805cfc`](https://github.com/Byron/gitoxide/commit/4805cfc8d837bb111424b5e32f46d0fb9b12365a)) + - Rename `git_hash::*::Digest` to `Id` ([`188d90a`](https://github.com/Byron/gitoxide/commit/188d90ad463d342d715af701b03f0ed392c977fc)) + * **[#691](https://github.com/Byron/gitoxide/issues/691)** + - set `rust-version` to 1.64 ([`55066ce`](https://github.com/Byron/gitoxide/commit/55066ce5fd71209abb5d84da2998b903504584bb)) + * **Uncategorized** + - Release gix-date v0.4.2, gix-hash v0.10.2, gix-features v0.26.4, gix-actor v0.17.1, gix-glob v0.5.3, gix-path v0.7.1, gix-quote v0.4.1, gix-attributes v0.8.2, gix-config-value v0.10.1, gix-tempfile v3.0.2, gix-lock v3.0.2, gix-validate v0.7.2, gix-object v0.26.1, gix-ref v0.24.0, gix-sec v0.6.2, gix-config v0.16.1, gix-command v0.2.3, gix-prompt v0.3.2, gix-url v0.13.2, gix-credentials v0.9.1, gix-diff v0.26.1, gix-discover v0.13.0, gix-hashtable v0.1.1, gix-bitmap v0.2.1, gix-traverse v0.22.1, gix-index v0.12.3, gix-mailmap v0.9.2, gix-chunk v0.4.1, gix-pack v0.30.2, gix-odb v0.40.2, gix-packetline v0.14.2, gix-transport v0.25.4, gix-protocol v0.26.3, gix-revision v0.10.3, gix-refspec v0.7.2, gix-worktree v0.12.2, gix v0.36.0 ([`6ccc88a`](https://github.com/Byron/gitoxide/commit/6ccc88a8e4a56973b1a358cf72dc012ee3c75d56)) + - Merge branch 'rename-crates' into inform-about-gix-rename ([`c9275b9`](https://github.com/Byron/gitoxide/commit/c9275b99ea43949306d93775d9d78c98fb86cfb1)) + - rename `git-testtools` to `gix-testtools` ([`b65c33d`](https://github.com/Byron/gitoxide/commit/b65c33d256cfed65d11adeff41132e3e58754089)) + - adjust to renaming of `git-pack` to `gix-pack` ([`1ee81ad`](https://github.com/Byron/gitoxide/commit/1ee81ad310285ee4aa118118a2be3810dbace574)) + - adjust to renaming of `git-odb` to `gix-odb` ([`476e2ad`](https://github.com/Byron/gitoxide/commit/476e2ad1a64e9e3f0d7c8651d5bcbee36cd78241)) + - adjust to renaming of `git-index` to `gix-index` ([`86db5e0`](https://github.com/Byron/gitoxide/commit/86db5e09fc58ce66b252dc13b8d7e2c48e4d5062)) + - adjust to renaming of `git-diff` to `gix-diff` ([`49a163e`](https://github.com/Byron/gitoxide/commit/49a163ec8b18f0e5fcd05a315de16d5d8be7650e)) + - adjust to renaming of `git-commitgraph` to `gix-commitgraph` ([`f1dd0a3`](https://github.com/Byron/gitoxide/commit/f1dd0a3366e31259af029da73228e8af2f414244)) + - adjust to renaming of `git-mailmap` to `gix-mailmap` ([`2e28c56`](https://github.com/Byron/gitoxide/commit/2e28c56bb9f70de6f97439818118d3a25859698f)) + - adjust to renaming of `git-discover` to `gix-discover` ([`53adfe1`](https://github.com/Byron/gitoxide/commit/53adfe1c34e9ea3b27067a97b5e7ac80b351c441)) + - adjust to renaming of `git-chunk` to `gix-chunk` ([`59194e3`](https://github.com/Byron/gitoxide/commit/59194e3a07853eae0624ebc4907478d1de4f7599)) + - adjust to renaming of `git-bitmap` to `gix-bitmap` ([`75f2a07`](https://github.com/Byron/gitoxide/commit/75f2a079b17489f62bc43e1f1d932307375c4f9d)) + - adjust to renaming for `git-protocol` to `gix-protocol` ([`823795a`](https://github.com/Byron/gitoxide/commit/823795addea3810243cab7936cd8ec0137cbc224)) + - adjust to renaming of `git-refspec` to `gix-refspec` ([`c958802`](https://github.com/Byron/gitoxide/commit/c9588020561577736faa065e7e5b5bb486ca8fe1)) + - adjust to renaming of `git-revision` to `gix-revision` ([`ee0ee84`](https://github.com/Byron/gitoxide/commit/ee0ee84607c2ffe11ee75f27a31903db68afed02)) + - adjust to renaming of `git-transport` to `gix-transport` ([`b2ccf71`](https://github.com/Byron/gitoxide/commit/b2ccf716dc4425bb96651d4d58806a3cc2da219e)) + - adjust to renaming of `git-credentials` to `gix-credentials` ([`6b18abc`](https://github.com/Byron/gitoxide/commit/6b18abcf2856f02ab938d535a65e51ac282bf94a)) + - adjust to renaming of `git-prompt` to `gix-prompt` ([`6a4654e`](https://github.com/Byron/gitoxide/commit/6a4654e0d10ab773dd219cb4b731c0fc1471c36d)) + - adjust to renaming of `git-command` to `gix-command` ([`d26b8e0`](https://github.com/Byron/gitoxide/commit/d26b8e046496894ae06b0bbfdba77196976cd975)) + - adjust to renaming of `git-packetline` to `gix-packetline` ([`5cbd22c`](https://github.com/Byron/gitoxide/commit/5cbd22cf42efb760058561c6c3bbcd4dab8c8be1)) + - adjust to renaming of `git-worktree` to `gix-worktree` ([`73a1282`](https://github.com/Byron/gitoxide/commit/73a12821b3d9b66ec1714d07dd27eb7a73e3a544)) + - adjust to renamining of `git-hashtable` to `gix-hashtable` ([`26a0c98`](https://github.com/Byron/gitoxide/commit/26a0c98d0a389b03e3dc7bfc758b37155e285244)) + - adjust to renamining of `git-worktree` to `gix-worktree` ([`108bb1a`](https://github.com/Byron/gitoxide/commit/108bb1a634f4828853fb590e9fc125f79441dd38)) + - adjust to renaming of `git-url` to `gix-url` ([`b50817a`](https://github.com/Byron/gitoxide/commit/b50817aadb143e19f61f64e19b19ec1107d980c6)) + - adjust to renaming of `git-date` to `gix-date` ([`9a79ff2`](https://github.com/Byron/gitoxide/commit/9a79ff2d5cc74c1efad9f41e21095ae498cce00b)) + - adjust to renamining of `git-attributes` to `gix-attributes` ([`4a8b3b8`](https://github.com/Byron/gitoxide/commit/4a8b3b812ac26f2a2aee8ce8ca81591273383c84)) + - adjust to renaminig of `git-quote` to `gix-quote` ([`648025b`](https://github.com/Byron/gitoxide/commit/648025b7ca94411fdd0d90c53e5faede5fde6c8d)) + - adjust to renaming of `git-config` to `gix-config` ([`3a861c8`](https://github.com/Byron/gitoxide/commit/3a861c8f049f6502d3bcbdac752659aa1aeda46a)) + - adjust to renaming of `git-ref` to `gix-ref` ([`1f5f695`](https://github.com/Byron/gitoxide/commit/1f5f695407b034377d94b172465ff573562b3fc3)) + - adjust to renaming of `git-lock` to `gix-lock` ([`2028e78`](https://github.com/Byron/gitoxide/commit/2028e7884ae1821edeec81612f501e88e4722b17)) + - adjust to renaming of `git-tempfile` to `gix-tempfile` ([`b6cc3eb`](https://github.com/Byron/gitoxide/commit/b6cc3ebb5137084a6327af16a7d9364d8f092cc9)) + - adjust to renaming of `git-object` to `gix-object` ([`fc86a1e`](https://github.com/Byron/gitoxide/commit/fc86a1e710ad7bf076c25cc6f028ddcf1a5a4311)) + - adjust to renaming of `git-actor` to `gix-actor` ([`4dc9b44`](https://github.com/Byron/gitoxide/commit/4dc9b44dc52f2486ffa2040585c6897c1bf55df4)) + - adjust to renaming of `git-validate` to `gix-validate` ([`5e40ad0`](https://github.com/Byron/gitoxide/commit/5e40ad078af3d08cbc2ca81ce755c0ed8a065b4f)) + - adjust to renaming of `git-hash` to `gix-hash` ([`4a9d025`](https://github.com/Byron/gitoxide/commit/4a9d0257110c3efa61d08c8457c4545b200226d1)) + - rename `git-hash` to `gix-hash` ([`416d1dc`](https://github.com/Byron/gitoxide/commit/416d1dcb71b40ca8a23e8793af4d44bbe9847c27)) + - adjust to renaming of `git-features` to `gix-features` ([`e2dd68a`](https://github.com/Byron/gitoxide/commit/e2dd68a417aad229e194ff20dbbfd77668096ec6)) + - adjust to renaming of `git-glob` to `gix-glob` ([`35b2a3a`](https://github.com/Byron/gitoxide/commit/35b2a3acbc8f2a03f151bc0a3863163844e0ca86)) + - adjust to renaming of `git-sec` to `gix-sec` ([`eabbb92`](https://github.com/Byron/gitoxide/commit/eabbb923bd5a32fc80fa80f96cfdc2ab7bb2ed17)) + - adapt to renaming of `git-path` to `gix-path` ([`d3bbcfc`](https://github.com/Byron/gitoxide/commit/d3bbcfccad80fc44ea8e7bf819f23adaca06ba2d)) + - adjust to rename of `git-config-value` to `gix-config-value` ([`622b3e1`](https://github.com/Byron/gitoxide/commit/622b3e1d0bffa0f8db73697960f9712024fac430)) + - Release git-date v0.4.2, git-hash v0.10.2, git-features v0.26.2, git-actor v0.17.1, git-glob v0.5.3, git-path v0.7.1, git-quote v0.4.1, git-attributes v0.8.2, git-config-value v0.10.1, git-tempfile v3.0.2, git-lock v3.0.2, git-validate v0.7.2, git-object v0.26.1, git-ref v0.24.0, git-sec v0.6.2, git-config v0.16.0, git-command v0.2.3, git-prompt v0.3.2, git-url v0.13.2, git-credentials v0.9.1, git-diff v0.26.1, git-discover v0.13.0, git-hashtable v0.1.1, git-bitmap v0.2.1, git-traverse v0.22.1, git-index v0.12.3, git-mailmap v0.9.2, git-chunk v0.4.1, git-pack v0.30.2, git-odb v0.40.2, git-packetline v0.14.2, git-transport v0.25.4, git-protocol v0.26.3, git-revision v0.10.2, git-refspec v0.7.2, git-worktree v0.12.2, git-repository v0.34.0, safety bump 3 crates ([`c196d20`](https://github.com/Byron/gitoxide/commit/c196d206d57a310b1ce974a1cf0e7e6d6db5c4d6)) + - prepare changelogs prior to release ([`7c846d2`](https://github.com/Byron/gitoxide/commit/7c846d2102dc767366771925212712ef8cc9bf07)) + - Merge branch 'Lioness100/main' ([`1e544e8`](https://github.com/Byron/gitoxide/commit/1e544e82455bf9ecb5e3c2146280eaf7ecd81f16)) + - fix typos ([`39ed9ed`](https://github.com/Byron/gitoxide/commit/39ed9eda62b7718d5109135e5ad406fb1fe2978c)) + - thanks clippy ([`bac57dd`](https://github.com/Byron/gitoxide/commit/bac57dd05ea2d5a4ee45ef9350fa3f2e19474bc0)) + - Optimize usage of `hex_to_id()` ([`6fa950d`](https://github.com/Byron/gitoxide/commit/6fa950d0ab1991a5577c06385169be1b390dd88a)) + - Break cyclical dev dependencies ([`1fea18f`](https://github.com/Byron/gitoxide/commit/1fea18f5f8b4189a23dc4fa3f041a672f6fbcfb3)) + - Release git-hash v0.10.1, git-hashtable v0.1.0 ([`7717170`](https://github.com/Byron/gitoxide/commit/771717095d9a67b0625021eb0928828ab686e772)) + - prepare changelogs prior to git-hashtable release ([`3bafb79`](https://github.com/Byron/gitoxide/commit/3bafb795afb901768ac0f3db99c9d2341a3e170f)) + - make fmt ([`747008d`](https://github.com/Byron/gitoxide/commit/747008d9d370844574dda94e5bec1648c4deb57e)) + - Merge branch 'main' into http-config ([`6b9632e`](https://github.com/Byron/gitoxide/commit/6b9632e16c416841ffff1b767ee7a6c89b421220)) + - Merge branch 'optimize_hashtables' ([`95ad56c`](https://github.com/Byron/gitoxide/commit/95ad56c11489bc46d6eb2b2f48cf0bf01e954c58)) + - switch to custom Hasher implementation ([`269d59e`](https://github.com/Byron/gitoxide/commit/269d59e0bee1f072096667b143800a0d85b18403)) + - Merge branch 'main' into http-config ([`bcd9654`](https://github.com/Byron/gitoxide/commit/bcd9654e56169799eb706646da6ee1f4ef2021a9)) + - Release git-hash v0.10.0, git-features v0.24.0, git-date v0.3.0, git-actor v0.14.0, git-glob v0.5.0, git-path v0.6.0, git-quote v0.4.0, git-attributes v0.6.0, git-config-value v0.9.0, git-tempfile v3.0.0, git-lock v3.0.0, git-validate v0.7.0, git-object v0.23.0, git-ref v0.20.0, git-sec v0.5.0, git-config v0.12.0, git-command v0.2.0, git-prompt v0.2.0, git-url v0.11.0, git-credentials v0.7.0, git-diff v0.23.0, git-discover v0.9.0, git-bitmap v0.2.0, git-traverse v0.19.0, git-index v0.9.0, git-mailmap v0.6.0, git-chunk v0.4.0, git-pack v0.27.0, git-odb v0.37.0, git-packetline v0.14.0, git-transport v0.23.0, git-protocol v0.24.0, git-revision v0.7.0, git-refspec v0.4.0, git-worktree v0.9.0, git-repository v0.29.0, git-commitgraph v0.11.0, gitoxide-core v0.21.0, gitoxide v0.19.0, safety bump 28 crates ([`b2c301e`](https://github.com/Byron/gitoxide/commit/b2c301ef131ffe1871314e19f387cf10a8d2ac16)) + - prepare changelogs prior to release ([`e4648f8`](https://github.com/Byron/gitoxide/commit/e4648f827c97e9d13636d1bbdc83dd63436e6e5c)) + - Merge branch 'version2021' ([`0e4462d`](https://github.com/Byron/gitoxide/commit/0e4462df7a5166fe85c23a779462cdca8ee013e8)) + - upgrade edition to 2021 in most crates. ([`3d8fa8f`](https://github.com/Byron/gitoxide/commit/3d8fa8fef9800b1576beab8a5bc39b821157a5ed)) + - Release git-hash v0.9.11, git-features v0.23.0, git-actor v0.13.0, git-attributes v0.5.0, git-object v0.22.0, git-ref v0.17.0, git-sec v0.4.1, git-config v0.9.0, git-url v0.10.0, git-credentials v0.6.0, git-diff v0.20.0, git-discover v0.6.0, git-traverse v0.18.0, git-index v0.6.0, git-mailmap v0.5.0, git-pack v0.24.0, git-odb v0.34.0, git-packetline v0.13.1, git-transport v0.21.0, git-protocol v0.21.0, git-revision v0.6.0, git-refspec v0.3.0, git-worktree v0.6.0, git-repository v0.25.0, safety bump 24 crates ([`104d922`](https://github.com/Byron/gitoxide/commit/104d922add61ab21c534c24ce8ed37cddf3e275a)) + - prepare changelogs for release ([`d232567`](https://github.com/Byron/gitoxide/commit/d23256701a95284857dc8d1cb37c7c94cada973c)) + - Merge branch 'main' into fetch-pack ([`d686020`](https://github.com/Byron/gitoxide/commit/d6860205db847b8a474756e92578195e1022481c)) + - thanks clippy ([`b9937ad`](https://github.com/Byron/gitoxide/commit/b9937adc2c31095dde63397be7d56f1ea559b0f7)) + - Merge branch 'diff' ([`25a7726`](https://github.com/Byron/gitoxide/commit/25a7726377fbe400ea3c4927d04e9dec99802b7b)) + - Release git-hash v0.9.10, git-features v0.22.5, git-date v0.2.0, git-actor v0.12.0, git-glob v0.4.0, git-path v0.5.0, git-quote v0.3.0, git-attributes v0.4.0, git-config-value v0.8.0, git-tempfile v2.0.5, git-validate v0.6.0, git-object v0.21.0, git-ref v0.16.0, git-sec v0.4.0, git-config v0.8.0, git-discover v0.5.0, git-traverse v0.17.0, git-index v0.5.0, git-worktree v0.5.0, git-testtools v0.9.0, git-command v0.1.0, git-prompt v0.1.0, git-url v0.9.0, git-credentials v0.5.0, git-diff v0.19.0, git-mailmap v0.4.0, git-chunk v0.3.2, git-pack v0.23.0, git-odb v0.33.0, git-packetline v0.13.0, git-transport v0.20.0, git-protocol v0.20.0, git-revision v0.5.0, git-refspec v0.2.0, git-repository v0.24.0, git-commitgraph v0.9.0, gitoxide-core v0.18.0, gitoxide v0.16.0, safety bump 28 crates ([`29a043b`](https://github.com/Byron/gitoxide/commit/29a043be6808a3e9199a9b26bd076fe843afe4f4)) + - make fmt ([`535e967`](https://github.com/Byron/gitoxide/commit/535e967666c6da657ff1b7eff7c64ab27cafb182)) + - Merge branch 'filter-refs-by-spec' ([`5c05198`](https://github.com/Byron/gitoxide/commit/5c051986bd89590a9287d85d84c713d83dfab83a)) + - Merge branch 'main' into filter-refs-by-spec ([`1f6e5ab`](https://github.com/Byron/gitoxide/commit/1f6e5ab15f5fd8d23719b13e6aea59cd231ac0fe)) + - Merge branch 'fix-522' ([`5869e9f`](https://github.com/Byron/gitoxide/commit/5869e9ff2508d5a93c07635277af8764fcb57713)) + - Release git-hash v0.9.9 ([`da0716f`](https://github.com/Byron/gitoxide/commit/da0716f8c27b4f29cfff0e5ce7fcb3d7240f4aeb)) + - fix docs ([`71cb9ea`](https://github.com/Byron/gitoxide/commit/71cb9eaefb792656b6380fdcc760c2234f9b9fa7)) + - replace `quickerror` with `thiserror` ([`7926f47`](https://github.com/Byron/gitoxide/commit/7926f47ebc34e11c769acfd3441ab391fc1b9b36)) + - some more tests ([`400c6cb`](https://github.com/Byron/gitoxide/commit/400c6cb14fe24b5e947f0c7f3a105deecd3b2f84)) + - Merge branch 'main' into index-from-tree ([`bc64b96`](https://github.com/Byron/gitoxide/commit/bc64b96a2ec781c72d1d4daad38aa7fb8b74f99b)) + - Merge branch 'main' into filter-refs-by-spec ([`cfa1440`](https://github.com/Byron/gitoxide/commit/cfa144031dbcac2707ab0cec012bc35e78f9c475)) + - Release git-date v0.0.5, git-hash v0.9.8, git-features v0.22.2, git-actor v0.11.3, git-glob v0.3.2, git-quote v0.2.1, git-attributes v0.3.2, git-tempfile v2.0.4, git-lock v2.1.1, git-validate v0.5.5, git-object v0.20.2, git-ref v0.15.2, git-sec v0.3.1, git-config v0.7.0, git-credentials v0.4.0, git-diff v0.17.2, git-discover v0.4.1, git-bitmap v0.1.2, git-index v0.4.2, git-mailmap v0.3.2, git-chunk v0.3.1, git-traverse v0.16.2, git-pack v0.21.2, git-odb v0.31.2, git-packetline v0.12.7, git-url v0.7.2, git-transport v0.19.2, git-protocol v0.19.0, git-revision v0.4.2, git-refspec v0.1.0, git-worktree v0.4.2, git-repository v0.22.0, safety bump 4 crates ([`4974eca`](https://github.com/Byron/gitoxide/commit/4974eca96d525d1ee4f8cad79bb713af7a18bf9d)) + - Merge branch 'main' into remote-ls-refs ([`e2ee3de`](https://github.com/Byron/gitoxide/commit/e2ee3ded97e5c449933712883535b30d151c7c78)) + - Merge branch 'docsrs-show-features' ([`31c2351`](https://github.com/Byron/gitoxide/commit/31c235140cad212d16a56195763fbddd971d87ce)) + - use docsrs feature in code to show what is feature-gated automatically on docs.rs ([`b1c40b0`](https://github.com/Byron/gitoxide/commit/b1c40b0364ef092cd52d03b34f491b254816b18d)) + - uniformize deny attributes ([`f7f136d`](https://github.com/Byron/gitoxide/commit/f7f136dbe4f86e7dee1d54835c420ec07c96cd78)) + - pass --cfg docsrs when compiling for https://docs.rs ([`5176771`](https://github.com/Byron/gitoxide/commit/517677147f1c17304c62cf97a1dd09f232ebf5db)) + - Merge branch 'main' into remote-ls-refs ([`bd5f3e8`](https://github.com/Byron/gitoxide/commit/bd5f3e8db7e0bb4abfb7b0f79f585ab82c3a14ab)) + - Release git-hash v0.9.7, git-features v0.22.1 ([`232784a`](https://github.com/Byron/gitoxide/commit/232784a59ded3e8016e4257c7e146ad385cdd64a)) + - Merge branch 'main' into remote-ls-refs ([`c4bf958`](https://github.com/Byron/gitoxide/commit/c4bf9585d815bc342e5fb383336cc654280dd34f)) + - first step towards everything being documented ([`919923c`](https://github.com/Byron/gitoxide/commit/919923c08b641ca148c2f25d193d65bb068cc787)) + - Merge branch 'main' into remote-ls-refs ([`de61c4d`](https://github.com/Byron/gitoxide/commit/de61c4db7855d6925d66961f62ae3d12cc4acf78)) + - thanks clippy ([`4bd747c`](https://github.com/Byron/gitoxide/commit/4bd747cb3e126fe5b1d540270cfbd731cffd42ef)) + - Merge branch 'rev-parse-delegate' ([`2f506c7`](https://github.com/Byron/gitoxide/commit/2f506c7c2988477b0f97d272a9ac9ed47b236457)) + - Merge pull request #2 from SidneyDouw/main ([`ce885ad`](https://github.com/Byron/gitoxide/commit/ce885ad4c3324c09c83751c32e014f246c748766)) + - Merge branch 'Byron:main' into main ([`9b9ea02`](https://github.com/Byron/gitoxide/commit/9b9ea0275f8ff5862f24cf5a4ca53bb1cd610709)) + - Merge branch 'main' into rev-parse-delegate ([`6da8250`](https://github.com/Byron/gitoxide/commit/6da82507588d3bc849217c11d9a1d398b67f2ed6)) + - Merge branch 'main' into pathspec ([`7b61506`](https://github.com/Byron/gitoxide/commit/7b615060712565f515515e35a3e8346278ad770c)) + - Release git-hash v0.9.6, git-features v0.22.0, git-date v0.0.2, git-actor v0.11.0, git-glob v0.3.1, git-path v0.4.0, git-attributes v0.3.0, git-tempfile v2.0.2, git-object v0.20.0, git-ref v0.15.0, git-sec v0.3.0, git-config v0.6.0, git-credentials v0.3.0, git-diff v0.17.0, git-discover v0.3.0, git-index v0.4.0, git-mailmap v0.3.0, git-traverse v0.16.0, git-pack v0.21.0, git-odb v0.31.0, git-url v0.7.0, git-transport v0.19.0, git-protocol v0.18.0, git-revision v0.3.0, git-worktree v0.4.0, git-repository v0.20.0, git-commitgraph v0.8.0, gitoxide-core v0.15.0, gitoxide v0.13.0, safety bump 22 crates ([`4737b1e`](https://github.com/Byron/gitoxide/commit/4737b1eea1d4c9a8d5a69fb63ecac5aa5d378ae5)) + - prepare changelog prior to release ([`3c50625`](https://github.com/Byron/gitoxide/commit/3c50625fa51350ec885b0f38ec9e92f9444df0f9)) + - Merge pull request #1 from Byron/main ([`085e76b`](https://github.com/Byron/gitoxide/commit/085e76b121291ed9bd324139105d2bd4117bedf8)) + - assure document-features are available in all 'usable' and 'early' crates ([`238581c`](https://github.com/Byron/gitoxide/commit/238581cc46c7288691eed37dc7de5069e3d86721)) + - Merge branch 'main' into pathspec ([`89ea12b`](https://github.com/Byron/gitoxide/commit/89ea12b558bcc056b892193ee8fb44b8664b5da4)) + - Merge branch 'main' into cont_include_if ([`41ea8ba`](https://github.com/Byron/gitoxide/commit/41ea8ba78e74f5c988148367386a1f4f304cb951)) + - Release git-date v0.0.1, git-hash v0.9.5, git-features v0.21.1, git-actor v0.10.1, git-path v0.2.0, git-attributes v0.2.0, git-ref v0.14.0, git-sec v0.2.0, git-config v0.5.0, git-credentials v0.2.0, git-discover v0.2.0, git-pack v0.20.0, git-odb v0.30.0, git-url v0.6.0, git-transport v0.18.0, git-protocol v0.17.0, git-revision v0.2.1, git-worktree v0.3.0, git-repository v0.19.0, safety bump 13 crates ([`a417177`](https://github.com/Byron/gitoxide/commit/a41717712578f590f04a33d27adaa63171f25267)) + - update changelogs prior to release ([`bb424f5`](https://github.com/Byron/gitoxide/commit/bb424f51068b8a8e762696890a55ab48900ab980)) + - Merge branch 'revspec-parsing' ([`a2c8969`](https://github.com/Byron/gitoxide/commit/a2c8969ba821fd387c39b14248074767f54749c8)) + - Merge branch 'main' into SidneyDouw-pathspec ([`a22b1d8`](https://github.com/Byron/gitoxide/commit/a22b1d88a21311d44509018729c3ef1936cf052a)) + - Merge branch 'main' into git_includeif ([`598c853`](https://github.com/Byron/gitoxide/commit/598c853087fcf8f77299aa5b9803bcec705c0cd0)) + - Release git-hash v0.9.4, git-features v0.21.0, git-actor v0.10.0, git-glob v0.3.0, git-path v0.1.1, git-attributes v0.1.0, git-sec v0.1.0, git-config v0.3.0, git-credentials v0.1.0, git-validate v0.5.4, git-object v0.19.0, git-diff v0.16.0, git-lock v2.1.0, git-ref v0.13.0, git-discover v0.1.0, git-index v0.3.0, git-mailmap v0.2.0, git-traverse v0.15.0, git-pack v0.19.0, git-odb v0.29.0, git-packetline v0.12.5, git-url v0.5.0, git-transport v0.17.0, git-protocol v0.16.0, git-revision v0.2.0, git-worktree v0.2.0, git-repository v0.17.0, safety bump 20 crates ([`654cf39`](https://github.com/Byron/gitoxide/commit/654cf39c92d5aa4c8d542a6cadf13d4acef6a78e)) + - make fmt ([`e043807`](https://github.com/Byron/gitoxide/commit/e043807abf364ca46d00760e2f281528efe20c75)) + - Merge branch 'main' into refs-and-worktrees ([`9cf0c7b`](https://github.com/Byron/gitoxide/commit/9cf0c7bd0cc5419137db5796f3a5b91bdf3dcc94)) + - Merge branch 'kalkin-improve-prefix' ([`0866e89`](https://github.com/Byron/gitoxide/commit/0866e89ad498f85478dccfabeb3b3f0b75d65442)) + - Implement `TryFrom<&str>` for `Prefix` ([`89f1b27`](https://github.com/Byron/gitoxide/commit/89f1b27af9acf46744501f4d31cd1298aeff039b)) + - Release git-hash v0.9.3, git-features v0.20.0, git-config v0.2.0, safety bump 12 crates ([`f0cbb24`](https://github.com/Byron/gitoxide/commit/f0cbb24b2e3d8f028be0e773f9da530da2656257)) + - make fmt ([`7cf3545`](https://github.com/Byron/gitoxide/commit/7cf354509b545f7e7c99e159b5989ddfbe86273d)) + - Merge branch 'short-id' ([`5849d5b`](https://github.com/Byron/gitoxide/commit/5849d5b326b83f98a16cf1d956c720c7f0fd4445)) + - Release git-hash v0.9.2, git-object v0.17.1, git-pack v0.16.1 ([`0db19b8`](https://github.com/Byron/gitoxide/commit/0db19b8deaf11a4d4cbc03fa3ae40eea104bc302)) + - update changelogs prior to git-pack release ([`b7e3a4a`](https://github.com/Byron/gitoxide/commit/b7e3a4afdd6417a38aadad35c7f584617e7b47fa)) + - Merge branch 'index-information' ([`025f157`](https://github.com/Byron/gitoxide/commit/025f157de10a509a4b36a9aed41de80487e8c15c)) + - Release git-hash v0.9.1, git-features v0.19.1, git-actor v0.8.0, git-config v0.1.10, git-object v0.17.0, git-diff v0.13.0, git-tempfile v1.0.4, git-chunk v0.3.0, git-traverse v0.12.0, git-pack v0.16.0, git-odb v0.26.0, git-packetline v0.12.3, git-url v0.3.5, git-transport v0.15.0, git-protocol v0.14.0, git-ref v0.11.0, git-repository v0.14.0, cargo-smart-release v0.8.0, safety bump 4 crates ([`373cbc8`](https://github.com/Byron/gitoxide/commit/373cbc877f7ad60dac682e57c52a7b90f108ebe3)) + - prepar changelogs for cargo-smart-release release ([`8900d69`](https://github.com/Byron/gitoxide/commit/8900d699226eb0995be70d66249827ce348261df)) + - don't use panicking const fn just yet to not require rust 1.57 ([`d2e2ea0`](https://github.com/Byron/gitoxide/commit/d2e2ea0a9b9c5f756d8b02b4872e6950faa03b3e)) + - Release git-bitmap v0.0.1, git-hash v0.9.0, git-features v0.19.0, git-index v0.1.0, safety bump 9 crates ([`4624725`](https://github.com/Byron/gitoxide/commit/4624725f54a34dd6b35d3632fb3516965922f60a)) + - Better not have items within items in changelogs ([`6946125`](https://github.com/Byron/gitoxide/commit/69461254b1bfda5e60911164096e4a061e241296)) + - thanks clippy ([`d8925f5`](https://github.com/Byron/gitoxide/commit/d8925f5bd7ac8ef2c98f0e57a1373e5ffba8ce23)) + - Release git-hash v0.8.0, git-features v0.17.0, git-actor v0.6.0, git-object v0.15.0, git-diff v0.11.0, git-traverse v0.10.0, git-pack v0.13.0, git-odb v0.23.0, git-packetline v0.12.0, git-transport v0.13.0, git-protocol v0.12.0, git-ref v0.9.0, git-repository v0.11.0, git-commitgraph v0.6.0, gitoxide-core v0.12.0, gitoxide v0.10.0, cargo-smart-release v0.5.0, safety bump 16 crates ([`0e02953`](https://github.com/Byron/gitoxide/commit/0e029537a7f6242d02ccf7e63d8d92f5246e6c5e)) + - break delete me ([`c5213d2`](https://github.com/Byron/gitoxide/commit/c5213d2b701ca71af5f3c987647e2a0c5c4d42dd)) + - Release git-hash v0.7.0, git-features v0.16.5, git-actor v0.5.3, git-config v0.1.7, git-validate v0.5.3, git-object v0.14.1, git-diff v0.10.0, git-tempfile v1.0.3, git-lock v1.0.1, git-traverse v0.9.0, git-pack v0.12.0, git-odb v0.22.0, git-packetline v0.11.0, git-url v0.3.4, git-transport v0.12.0, git-protocol v0.11.0, git-ref v0.8.0, git-repository v0.10.0, cargo-smart-release v0.4.0 ([`59ffbd9`](https://github.com/Byron/gitoxide/commit/59ffbd9f15583c8248b7f48b3f55ec6faffe7cfe)) + - Adjusting changelogs prior to release of git-hash v0.7.0, git-features v0.16.5, git-actor v0.5.3, git-validate v0.5.3, git-object v0.14.1, git-diff v0.10.0, git-tempfile v1.0.3, git-lock v1.0.1, git-traverse v0.9.0, git-pack v0.12.0, git-odb v0.22.0, git-packetline v0.11.0, git-url v0.3.4, git-transport v0.12.0, git-protocol v0.11.0, git-ref v0.8.0, git-repository v0.10.0, cargo-smart-release v0.4.0, safety bump 3 crates ([`a474395`](https://github.com/Byron/gitoxide/commit/a47439590e36b1cb8b516b6053fd5cbfc42efed7)) + - Update changelogs just for fun ([`21541b3`](https://github.com/Byron/gitoxide/commit/21541b3301de1e053fc0e84373be60d2162fbaae)) + - Merge branch 'repository-integration' ([`49f5453`](https://github.com/Byron/gitoxide/commit/49f5453629646ac24d752f53c532e5f67eb09374)) + - Bump git-hash v0.6.0 ([`6efd90d`](https://github.com/Byron/gitoxide/commit/6efd90db54f7f7441b76159dba3be80c15657a3d)) + - [repository #190] obtain the kind fo hash used in a repo ([`a985491`](https://github.com/Byron/gitoxide/commit/a985491bcea5f76942b863de8a9a89dd235dd0c9)) + - Release git-hash v0.5.1 ([`d826370`](https://github.com/Byron/gitoxide/commit/d826370b88d45fd2a421d3a59c232ed1504c6b0c)) + - Apply nightly rustfmt rules. ([`5e0edba`](https://github.com/Byron/gitoxide/commit/5e0edbadb39673d4de640f112fa306349fb11814)) + - (cargo-release) version 0.5.0 ([`ae02dab`](https://github.com/Byron/gitoxide/commit/ae02dabae961089a92a21e6a60a7006de4b56dad)) + - thanks clippy ([`e1964e4`](https://github.com/Byron/gitoxide/commit/e1964e43979b3e32a5d4bfbe377a842d2c0b10ea)) + - [ref] flexible and simple support for different hash lengths ([`9c2edd5`](https://github.com/Byron/gitoxide/commit/9c2edd537fb86d2d7db874ec976d0cb1b8ec7c2e)) + - Revert "[ref] parameterize all uses of hash length…" ([`21f187e`](https://github.com/Byron/gitoxide/commit/21f187e6b7011bb59ed935fc1a2d0a5557890ffe)) + - [ref] parameterize all uses of hash length… ([`5c7285e`](https://github.com/Byron/gitoxide/commit/5c7285e7233390fd7589188084fcd05febcbbac2)) + - [ref] handle create-or-append when writing valid reflog files… ([`9175085`](https://github.com/Byron/gitoxide/commit/9175085248855a7ffa0d4e006740eafc0f4e1c92)) + - [ref] another deletion test succeeds ([`6037900`](https://github.com/Byron/gitoxide/commit/60379001d2729627c042f304217d6459f99f01bf)) + - thanks clippy ([`6200ed9`](https://github.com/Byron/gitoxide/commit/6200ed9ac5609c74de4254ab663c19cfe3591402)) + - (cargo-release) version 0.4.0 ([`866f86f`](https://github.com/Byron/gitoxide/commit/866f86f59e66652968dcafc1a57912f9849cb21d)) + - [git-repository] towards git-repository as one stop shop ([`aea6cc5`](https://github.com/Byron/gitoxide/commit/aea6cc536f438050cc0e02223de7702cd7912e75)) + - (cargo-release) version 0.3.0 ([`e9665c7`](https://github.com/Byron/gitoxide/commit/e9665c784ae7e5cdaf662151395ee2355e9b57b6)) + - [traversal] trying to get things done with gitoxide shows some teeth… ([`3fee661`](https://github.com/Byron/gitoxide/commit/3fee661af8d67e277e8657606383a670f17e7825)) + - Nicer debug printing for oids, too ([`b4f94f8`](https://github.com/Byron/gitoxide/commit/b4f94f8af662bf6cdc001ca7b59478c701a40e36)) + - a new failing test ([`86b6c24`](https://github.com/Byron/gitoxide/commit/86b6c2497cfa17bf3f822792e3afe406f7968ee7)) + - fix git-hash docs ([`327a107`](https://github.com/Byron/gitoxide/commit/327a107afd696f7496e04bd6285c217cd8cdc136)) + - (cargo-release) version 0.2.0 ([`4ec09f4`](https://github.com/Byron/gitoxide/commit/4ec09f4d2239ea1d44f7145027e64191bf2c158c)) + - (cargo-release) version 0.1.2 ([`d1b4436`](https://github.com/Byron/gitoxide/commit/d1b44369bcca34516c8bf86a540a4591d64ec9ba)) + - update tasks and dependencies ([`96938be`](https://github.com/Byron/gitoxide/commit/96938be512efd6d6ad26238f258865d7488098f4)) + - Add missing '.' at end of doc comments ([`7136854`](https://github.com/Byron/gitoxide/commit/71368544f97369a4d371d43513607c4805bd0fd0)) + - (cargo-release) version 0.1.1 ([`4224c5b`](https://github.com/Byron/gitoxide/commit/4224c5b5ceeb6bd1dbe4aac46018be5cc82b77df)) + - All crates use git-hash::Kind and its types, sometimes through git-object ([`124c171`](https://github.com/Byron/gitoxide/commit/124c171aaf546d8977e9913ff84e65383a80ee98)) + - first incarnation of git-hash to separate concerns and resolve cycle ([`9803041`](https://github.com/Byron/gitoxide/commit/9803041c29c18f2976531c9b487e63cd90fa3e72)) +
+ + + oid::null_sha1() replaced with Kind::null() remove ObjectId::from_borrowed_sha1() remove ObjectId::to_sha1_hex_string()Use .to_hex().to_string() instead. SIZE_OF_SHA1_DIGEST is now privateReplace it with your own constant derived fromgit_hash::Kind::Sha1.len_in_bytes() or even better, make thisvalue configurable once it’s clear how differently sized hashesare used within gits files. rename Kind::to_hex() to Kind::to_hex_with_len(); add Kind::to_hex()The latter prints the oid in full. + +## 0.10.1 (2022-12-01) + +A maintenance release without user-facing changes. + +## 0.10.0 (2022-11-21) + +### New Features (BREAKING) + + - upgrade edition to 2021 in most crates. + MSRV for this is 1.56, and we are now at 1.60 so should be compatible. + This isn't more than a patch release as it should break nobody + who is adhering to the MSRV, but let's be careful and mark it + breaking. + + Note that `gix-features` and `gix-pack` are still on edition 2018 + as they make use of a workaround to support (safe) mutable access + to non-overlapping entries in a slice which doesn't work anymore + in edition 2021. + +## 0.9.11 (2022-10-10) + +Maintenance release without user-facing changes. + +## 0.9.10 (2022-09-20) + +Maintenance release without observable changes. + +## 0.9.9 (2022-09-02) + + + +### Bug Fixes + + - don't assume hex-only characters in `ObjectId::from_hex(…)`. + +### Refactor + + - replace `quickerror` with `thiserror` + +## 0.9.8 (2022-08-24) + + + +### Chore + + - uniformize deny attributes + +### New Features + + - use docsrs feature in code to show what is feature-gated automatically on docs.rs + - pass --cfg docsrs when compiling for https://docs.rs + +## 0.9.7 (2022-08-15) + +### New Features + + - `Prefix::from(ObjectId)` + This conversion will never fail and is useful as fallback to handle + failed hash shortenings, which can now default to a prefix that + represents the original and thus unique hash. + +## 0.9.6 (2022-07-22) + +This is a maintenance release with no functional changes. + +## 0.9.5 (2022-06-13) + +### New Features + + - expose `Prefix::MIN_HEX_LEN`. + That way other crates can know which candidates to discard off the bat + instead of having to match on an error. It's mere convenience. + +## 0.9.4 (2022-05-18) + +### New Features + + - `Prefix::from_hex()` + - Implement `TryFrom<&str>` for `Prefix` + Currently there is no easy way to create a `struct Prefix` from a hex + string. The method `Parser::from_hex()` is NIY. + +## 0.9.3 (2022-04-02) + +### New Features + + - `Commit::short_id()` + - gix-hash::Prefix::from_id() + A way to obtain a prefix of an object id, with all non-prefix + bytes set to zero. + +### Bug Fixes + + - don't use panicking const fn just yet to not require rust 1.57 + +## 0.9.2 (2022-02-01) + +A automated maintenance release without impact to the public API. + +### New Features + + - Implement Display for hash kind + This helps 'clap' and allows for a little more type-safety during + declaration. + +## 0.9.1 (2022-01-23) + +### Changed (BREAKING) + + + + + + + + - rename `oid::try_from()` to `try_from_bytes()`, add `from_bytes_unchecked()` + This change was done in the name of consistency, as `from_bytes()` is + used in many other git-* crates + - Remove `Kind:Efrom_len_in_bytes()` from public API + It shouldn't be encouraged to assume the hash can be deduced from its + length, also git doesn't assume this. + + If that would happen, we would have other problems though, so let's hope + it doesn't happen nonetheless. + - Remove `ObjectId::null_sha1()` from public API + Use `Kind::Sha1.null()` instead if it's a value where the actual + repository object hash doesn't matter. + - rename `Kind::null()` to `null_ref()` and `Kind::null_owned()` to `null()` + This naming is consistent with typical Rust APIs and the naming used + throughout the git-* crates thus far. + - remove `Kind::new_sha1()` from public API + - Kind::from_len_in_bytes() is infallible + - remove `ObjectId::from_20_bytes()` from public API + Use `ObjectId::from()` or `ObjectId::try_from()` instead. + - remove various SHA1 specific hex utilities in favor of unspecific new ones + - removed `to_sha1_hex()`, use `oid::hex_to_buf()` and + `oid::hex_to_buf()` instead. + +### New Features + + - Implement Display for hash kind + This helps 'clap' and allows for a little more type-safety during + declaration. + - Assign version numbers to `Kind` and implement `TryFrom` + This makes reading and writing the hash number easier for newer file + formats. + - add `Kind::from_len_in_bytes()` const fn + - `Kind::len_in_bytes()` method + It yields the amount of bytes needed to store the hash. + +### Bug Fixes + + - don't use panicking const fn just yet to not require rust 1.57 + +## 0.9.0 (2022-01-19) + +### New Features + + - Assign version numbers to `Kind` and implement `TryFrom` + This makes reading and writing the hash number easier for newer file + formats. + - add `Kind::from_len_in_bytes()` const fn + - `Kind::len_in_bytes()` method + It yields the amount of bytes needed to store the hash. + +### Changed (BREAKING) + + - rename `oid::try_from()` to `try_from_bytes()`, add `from_bytes_unchecked()` + This change was done in the name of consistency, as `from_bytes()` is + used in many other git-* crates + - Remove `Kind:Efrom_len_in_bytes()` from public API + It shouldn't be encouraged to assume the hash can be deduced from its + length, also git doesn't assume this. + + If that would happen, we would have other problems though, so let's hope + it doesn't happen nonetheless. + - Remove `ObjectId::null_sha1()` from public API + Use `Kind::Sha1.null()` instead if it's a value where the actual + repository object hash doesn't matter. + - rename `Kind::null()` to `null_ref()` and `Kind::null_owned()` to `null()` + This naming is consistent with typical Rust APIs and the naming used + throughout the git-* crates thus far. + - remove `Kind::new_sha1()` from public API + - Kind::from_len_in_bytes() is infallible + - remove `ObjectId::from_20_bytes()` from public API + Use `ObjectId::from()` or `ObjectId::try_from()` instead. + - remove various SHA1 specific hex utilities in favor of unspecific new ones. + + removed `to_sha1_hex()`, use `oid::hex_to_buf()` and `oid::hex_to_buf()` instead. + remove `ObjectId::write_hex_to()` in favor of `oid::write_hex_to()` + - `oid::null_sha1()` replaced with `Kind::null()` + - remove `ObjectId::from_borrowed_sha1()` + - remove `ObjectId::to_sha1_hex_string()` + Use `.to_hex().to_string()` instead. + - SIZE_OF_SHA1_DIGEST is now private + Replace it with your own constant derived from + - rename `Kind::to_hex()` to `Kind::to_hex_with_len()`; add `Kind::to_hex()` + The latter prints the oid in full. + +## v0.8.0 (2021-10-19) + + + +A maintenance release due to reset the entire crate graph to new minor releases. + +## v0.7.0 (2021-10-15) + + + + +### BREAKING Changes + + - rename `oid::short_hex()` to `oid::to_hex()` + - `oid::short_hex(len)` for truncated hex representations + +## v0.6.0 (2021-09-07) + +### Breaking + +- `ObjectId::empty_tree()` now has a parameter: `Kind` +- `ObjectId::null_sha(…)` -> `ObjectId::null(…)` + +## v0.5.1 (2021-08-17) + +## v0.5.0 (2021-08-10) + +## v0.3.0 (2021-04-30) + +## v0.2.0 (2021-04-08) + +## v0.1.2 (2021-01-12) + +## v0.1.1 (2020-12-16) + +## v0.1.0 (2020-12-16) + diff --git a/vendor/gix-hash/Cargo.toml b/vendor/gix-hash/Cargo.toml new file mode 100644 index 000000000..1206fd543 --- /dev/null +++ b/vendor/gix-hash/Cargo.toml @@ -0,0 +1,57 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2021" +rust-version = "1.64" +name = "gix-hash" +version = "0.10.3" +authors = ["Sebastian Thiel "] +include = [ + "src/**/*", + "CHANGELOG.md", +] +description = "Borrowed and owned git hash digests used to identify git objects" +license = "MIT/Apache-2.0" +repository = "https://github.com/Byron/gitoxide" + +[package.metadata.docs.rs] +all-features = true +features = ["document-features"] +rustdoc-args = [ + "--cfg", + "docsrs", +] + +[lib] +test = false +doctest = false + +[dependencies.document-features] +version = "0.2.0" +optional = true + +[dependencies.hex] +version = "0.4.2" + +[dependencies.serde] +version = "1.0.114" +features = ["derive"] +optional = true +default-features = false + +[dependencies.thiserror] +version = "1.0.33" + +[dev-dependencies] + +[features] +serde1 = ["serde"] diff --git a/vendor/gix-hash/src/kind.rs b/vendor/gix-hash/src/kind.rs new file mode 100644 index 000000000..86faddda2 --- /dev/null +++ b/vendor/gix-hash/src/kind.rs @@ -0,0 +1,122 @@ +use std::{convert::TryFrom, str::FromStr}; + +use crate::{oid, Kind, ObjectId}; + +impl Default for Kind { + fn default() -> Self { + Kind::Sha1 + } +} + +impl TryFrom for Kind { + type Error = u8; + + fn try_from(value: u8) -> Result { + Ok(match value { + 1 => Kind::Sha1, + unknown => return Err(unknown), + }) + } +} + +impl FromStr for Kind { + type Err = String; + + fn from_str(s: &str) -> Result { + Ok(match s { + "sha1" | "SHA1" => Kind::Sha1, + other => return Err(other.into()), + }) + } +} + +impl std::fmt::Display for Kind { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Kind::Sha1 => f.write_str("SHA1"), + } + } +} + +impl Kind { + /// Returns the shortest hash we support + #[inline] + pub const fn shortest() -> Self { + Self::Sha1 + } + + /// Returns the longest hash we support + #[inline] + pub const fn longest() -> Self { + Self::Sha1 + } + + /// Returns a buffer suitable to hold the longest possible hash in hex. + #[inline] + pub const fn hex_buf() -> [u8; Kind::longest().len_in_hex()] { + [0u8; Kind::longest().len_in_hex()] + } + + /// Returns a buffer suitable to hold the longest possible hash as raw bytes. + #[inline] + pub const fn buf() -> [u8; Kind::longest().len_in_bytes()] { + [0u8; Kind::longest().len_in_bytes()] + } + + /// Returns the amount of ascii-characters needed to encode this has in hex + #[inline] + pub const fn len_in_hex(&self) -> usize { + match self { + Kind::Sha1 => 40, + } + } + /// Returns the amount of bytes taken up by the hash of the current kind + #[inline] + pub const fn len_in_bytes(&self) -> usize { + match self { + Kind::Sha1 => 20, + } + } + + /// Returns the kind of hash that would fit the given `hex_len`, or `None` if there is no fitting hash. + /// Note that 0 as `hex_len` fits always yields Sha1. + #[inline] + pub const fn from_hex_len(hex_len: usize) -> Option { + Some(match hex_len { + 0..=40 => Kind::Sha1, + _ => return None, + }) + } + + /// Converts a size in bytes as obtained by `Kind::len_in_bytes()` into the corresponding hash kind, if possible. + /// + /// **Panics** if the hash length doesn't match a known hash. + /// + /// NOTE that this method isn't public as it shouldn't be encouraged to assume all hashes have the same length. + /// However, if there should be such a thing, our `oid` implementation will have to become an enum and it's pretty breaking + /// to the way it's currently being used as auto-dereffing doesn't work anymore. Let's hope it won't happen. + // TODO: make 'const' once Rust 1.57 is more readily available in projects using 'gitoxide'. + #[inline] + pub(crate) fn from_len_in_bytes(bytes: usize) -> Self { + match bytes { + 20 => Kind::Sha1, + _ => panic!("BUG: must be called only with valid hash lengths produced by len_in_bytes()"), + } + } + + /// Create a null-id of our hash kind. + #[inline] + pub fn null_ref(&self) -> &'static oid { + match self { + Kind::Sha1 => oid::null_sha1(), + } + } + + /// Create a null-id of our hash kind. + #[inline] + pub const fn null(&self) -> ObjectId { + match self { + Kind::Sha1 => ObjectId::null_sha1(), + } + } +} diff --git a/vendor/gix-hash/src/lib.rs b/vendor/gix-hash/src/lib.rs new file mode 100644 index 000000000..c40c4b8f0 --- /dev/null +++ b/vendor/gix-hash/src/lib.rs @@ -0,0 +1,42 @@ +//! This crate provides types for identifying git objects using a hash digest. +//! +//! These are provided in borrowed versions as well as owned ones. +//! ## Feature Flags +#![cfg_attr( + feature = "document-features", + cfg_attr(doc, doc = ::document_features::document_features!()) +)] +#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![deny(missing_docs, rust_2018_idioms, unsafe_code)] + +#[path = "oid.rs"] +mod borrowed; +pub use borrowed::oid; + +mod object_id; +pub use object_id::{decode, ObjectId}; + +/// +pub mod prefix; + +/// An partial owned hash possibly identifying an object uniquely, +/// whose non-prefix bytes are zeroed. +#[derive(PartialEq, Eq, Hash, Ord, PartialOrd, Clone, Copy, Debug)] +#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] +pub struct Prefix { + bytes: ObjectId, + hex_len: usize, +} + +/// The size of a SHA1 hash digest in bytes +const SIZE_OF_SHA1_DIGEST: usize = 20; + +/// Denotes the kind of function to produce a `Id` +#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)] +#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] +pub enum Kind { + /// The Sha1 hash with 160 bits. + Sha1 = 1, +} + +mod kind; diff --git a/vendor/gix-hash/src/object_id.rs b/vendor/gix-hash/src/object_id.rs new file mode 100644 index 000000000..d295fc555 --- /dev/null +++ b/vendor/gix-hash/src/object_id.rs @@ -0,0 +1,229 @@ +use std::{ + borrow::Borrow, + convert::TryInto, + fmt, + hash::{Hash, Hasher}, + ops::Deref, +}; + +use crate::{borrowed::oid, Kind, SIZE_OF_SHA1_DIGEST}; + +/// An owned hash identifying objects, most commonly Sha1 +#[derive(PartialEq, Eq, Ord, PartialOrd, Clone, Copy)] +#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] +pub enum ObjectId { + /// A SHA 1 hash digest + Sha1([u8; SIZE_OF_SHA1_DIGEST]), +} + +// False positive: https://github.com/rust-lang/rust-clippy/issues/2627 +// ignoring some fields while hashing is perfectly valid and just leads to +// increased HashCollisions. One Sha1 being a prefix of another Sha256 is +// extremely unlikely to begin with so it doesn't matter. +// This implementation matches the `Hash` implementation for `oid` +// and allows the usage of custom Hashers that only copy a truncated ShaHash +#[allow(clippy::derive_hash_xor_eq)] +impl Hash for ObjectId { + fn hash(&self, state: &mut H) { + state.write(self.as_slice()) + } +} + +#[allow(missing_docs)] +pub mod decode { + use std::str::FromStr; + + use crate::object_id::ObjectId; + + /// An error returned by [`ObjectId::from_hex()`][crate::ObjectId::from_hex()] + #[derive(Debug, thiserror::Error)] + #[allow(missing_docs)] + pub enum Error { + #[error("A hash sized {0} hexadecimal characters is invalid")] + InvalidHexEncodingLength(usize), + #[error("Invalid character {c} at position {index}")] + Invalid { c: char, index: usize }, + } + + /// Hash decoding + impl ObjectId { + /// Create an instance from a `buffer` of 40 bytes encoded with hexadecimal notation. + /// + /// Such a buffer can be obtained using [`oid::write_hex_to(buffer)`][super::oid::write_hex_to()] + pub fn from_hex(buffer: &[u8]) -> Result { + use hex::FromHex; + match buffer.len() { + 40 => Ok(ObjectId::Sha1(<[u8; 20]>::from_hex(buffer).map_err( + |err| match err { + hex::FromHexError::InvalidHexCharacter { c, index } => Error::Invalid { c, index }, + hex::FromHexError::OddLength | hex::FromHexError::InvalidStringLength => { + unreachable!("BUG: This is already checked") + } + }, + )?)), + len => Err(Error::InvalidHexEncodingLength(len)), + } + } + } + + impl FromStr for ObjectId { + type Err = Error; + + fn from_str(s: &str) -> Result { + Self::from_hex(s.as_bytes()) + } + } +} + +/// Access and conversion +impl ObjectId { + /// Returns the kind of hash used in this `Id` + #[inline] + pub fn kind(&self) -> crate::Kind { + match self { + ObjectId::Sha1(_) => crate::Kind::Sha1, + } + } + /// Return the raw byte slice representing this hash + #[inline] + pub fn as_slice(&self) -> &[u8] { + match self { + Self::Sha1(b) => b.as_ref(), + } + } + /// Return the raw mutable byte slice representing this hash + #[inline] + pub fn as_mut_slice(&mut self) -> &mut [u8] { + match self { + Self::Sha1(b) => b.as_mut(), + } + } + + /// The hash of an empty blob + #[inline] + pub const fn empty_blob(hash: Kind) -> ObjectId { + match hash { + Kind::Sha1 => { + ObjectId::Sha1(*b"\xe6\x9d\xe2\x9b\xb2\xd1\xd6\x43\x4b\x8b\x29\xae\x77\x5a\xd8\xc2\xe4\x8c\x53\x91") + } + } + } + + /// The hash of an empty tree + #[inline] + pub const fn empty_tree(hash: Kind) -> ObjectId { + match hash { + Kind::Sha1 => { + ObjectId::Sha1(*b"\x4b\x82\x5d\xc6\x42\xcb\x6e\xb9\xa0\x60\xe5\x4b\xf8\xd6\x92\x88\xfb\xee\x49\x04") + } + } + } + + /// Returns true if this hash consists of all null bytes + #[inline] + pub fn is_null(&self) -> bool { + match self { + ObjectId::Sha1(digest) => &digest[..] == oid::null_sha1().as_bytes(), + } + } + + /// Returns an Digest representing a hash with whose memory is zeroed. + #[inline] + pub const fn null(kind: crate::Kind) -> ObjectId { + match kind { + crate::Kind::Sha1 => Self::null_sha1(), + } + } +} + +/// Sha1 hash specific methods +impl ObjectId { + /// Instantiate an Digest from 20 bytes of a Sha1 digest. + #[inline] + fn new_sha1(id: [u8; SIZE_OF_SHA1_DIGEST]) -> Self { + ObjectId::Sha1(id) + } + + /// Instantiate an Digest from a slice 20 borrowed bytes of a Sha1 digest. + /// + /// Panics of the slice doesn't have a length of 20. + #[inline] + pub(crate) fn from_20_bytes(b: &[u8]) -> ObjectId { + let mut id = [0; SIZE_OF_SHA1_DIGEST]; + id.copy_from_slice(b); + ObjectId::Sha1(id) + } + + /// Returns an Digest representing a Sha1 with whose memory is zeroed. + #[inline] + pub(crate) const fn null_sha1() -> ObjectId { + ObjectId::Sha1([0u8; 20]) + } +} + +impl std::fmt::Debug for ObjectId { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + ObjectId::Sha1(_hash) => f.write_str("Sha1(")?, + } + for b in self.as_bytes() { + write!(f, "{b:02x}")?; + } + f.write_str(")") + } +} + +impl From<[u8; SIZE_OF_SHA1_DIGEST]> for ObjectId { + fn from(v: [u8; 20]) -> Self { + Self::new_sha1(v) + } +} + +impl From<&[u8]> for ObjectId { + fn from(v: &[u8]) -> Self { + match v.len() { + 20 => Self::Sha1(v.try_into().expect("prior length validation")), + other => panic!("BUG: unsupported hash len: {other}"), + } + } +} + +impl From<&crate::oid> for ObjectId { + fn from(v: &oid) -> Self { + match v.kind() { + crate::Kind::Sha1 => ObjectId::from_20_bytes(v.as_bytes()), + } + } +} + +impl Deref for ObjectId { + type Target = oid; + + fn deref(&self) -> &Self::Target { + self.as_ref() + } +} + +impl AsRef for ObjectId { + fn as_ref(&self) -> &oid { + oid::from_bytes_unchecked(self.as_slice()) + } +} + +impl Borrow for ObjectId { + fn borrow(&self) -> &oid { + self.as_ref() + } +} + +impl fmt::Display for ObjectId { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.to_hex()) + } +} + +impl PartialEq<&crate::oid> for ObjectId { + fn eq(&self, other: &&oid) -> bool { + self.as_ref() == *other + } +} diff --git a/vendor/gix-hash/src/oid.rs b/vendor/gix-hash/src/oid.rs new file mode 100644 index 000000000..92ded0f87 --- /dev/null +++ b/vendor/gix-hash/src/oid.rs @@ -0,0 +1,257 @@ +use std::{convert::TryInto, fmt}; + +use crate::{ObjectId, SIZE_OF_SHA1_DIGEST}; + +/// A borrowed reference to a hash identifying objects. +/// +/// # Future Proofing +/// +/// In case we wish to support multiple hashes with the same length we cannot discriminate +/// using the slice length anymore. To make that work, we will use the high bits of the +/// internal `bytes` slice length (a fat pointer, pointing to data and its length in bytes) +/// to encode additional information. Before accessing or returning the bytes, a new adjusted +/// slice will be constructed, while the high bits will be used to help resolving the +/// hash `[`kind()`][oid::kind()]`. +/// We expect to have quite a few bits available for such 'conflict resolution' as most hashes aren't longer +/// than 64 bytes. +#[derive(PartialEq, Eq, Hash, Ord, PartialOrd)] +#[repr(transparent)] +#[allow(non_camel_case_types)] +#[cfg_attr(feature = "serde1", derive(serde::Serialize))] +pub struct oid { + bytes: [u8], +} + +/// A utility able to format itself with the given amount of characters in hex +#[derive(PartialEq, Eq, Hash, Ord, PartialOrd)] +pub struct HexDisplay<'a> { + inner: &'a oid, + hex_len: usize, +} + +impl<'a> fmt::Display for HexDisplay<'a> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let mut hex = crate::Kind::hex_buf(); + let max_len = self.inner.hex_to_buf(hex.as_mut()); + let hex = std::str::from_utf8(&hex[..self.hex_len.min(max_len)]).expect("ascii only in hex"); + f.write_str(hex) + } +} + +impl fmt::Debug for oid { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result { + write!( + f, + "{}({})", + match self.kind() { + crate::Kind::Sha1 => "Sha1", + }, + self.to_hex(), + ) + } +} + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error("Cannot instantiate git hash from a digest of length {0}")] + InvalidByteSliceLength(usize), +} + +/// Conversion +impl oid { + /// Try to create a shared object id from a slice of bytes representing a hash `digest` + #[inline] + pub fn try_from_bytes(digest: &[u8]) -> Result<&Self, Error> { + match digest.len() { + 20 => Ok( + #[allow(unsafe_code)] + unsafe { + &*(digest as *const [u8] as *const oid) + }, + ), + len => Err(Error::InvalidByteSliceLength(len)), + } + } + + /// Create an OID from the input `value` slice without performing any safety check. + /// Use only once sure that `value` is a hash of valid length. + pub fn from_bytes_unchecked(value: &[u8]) -> &Self { + Self::from_bytes(value) + } + + /// Only from code that statically assures correct sizes using array conversions + pub(crate) fn from_bytes(value: &[u8]) -> &Self { + #[allow(unsafe_code)] + unsafe { + &*(value as *const [u8] as *const oid) + } + } +} + +/// Access +impl oid { + /// The kind of hash used for this Digest + #[inline] + pub fn kind(&self) -> crate::Kind { + crate::Kind::from_len_in_bytes(self.bytes.len()) + } + + /// The first byte of the hash, commonly used to partition a set of `Id`s + #[inline] + pub fn first_byte(&self) -> u8 { + self.bytes[0] + } + + /// Interpret this object id as raw byte slice. + #[inline] + pub fn as_bytes(&self) -> &[u8] { + &self.bytes + } + + /// Return a type which can display itself in hexadecimal form with the `len` amount of characters. + #[inline] + pub fn to_hex_with_len(&self, len: usize) -> HexDisplay<'_> { + HexDisplay { + inner: self, + hex_len: len, + } + } + + /// Return a type which displays this oid as hex in full. + #[inline] + pub fn to_hex(&self) -> HexDisplay<'_> { + HexDisplay { + inner: self, + hex_len: self.bytes.len() * 2, + } + } +} + +/// Sha1 specific methods +impl oid { + /// Write ourselves to the `out` in hexadecimal notation, returning the amount of written bytes. + /// + /// **Panics** if the buffer isn't big enough to hold twice as many bytes as the current binary size. + #[inline] + #[must_use] + pub fn hex_to_buf(&self, buf: &mut [u8]) -> usize { + let num_hex_bytes = self.bytes.len() * 2; + hex::encode_to_slice(&self.bytes, &mut buf[..num_hex_bytes]).expect("to count correctly"); + num_hex_bytes + } + + /// Write ourselves to `out` in hexadecimal notation + #[inline] + pub fn write_hex_to(&self, mut out: impl std::io::Write) -> std::io::Result<()> { + let mut hex = crate::Kind::hex_buf(); + let hex_len = self.hex_to_buf(&mut hex); + out.write_all(&hex[..hex_len]) + } + + /// Returns a Sha1 digest with all bytes being initialized to zero. + #[inline] + pub(crate) fn null_sha1() -> &'static Self { + oid::from_bytes([0u8; SIZE_OF_SHA1_DIGEST].as_ref()) + } +} + +impl AsRef for &oid { + fn as_ref(&self) -> &oid { + self + } +} + +impl ToOwned for oid { + type Owned = crate::ObjectId; + + fn to_owned(&self) -> Self::Owned { + match self.kind() { + crate::Kind::Sha1 => crate::ObjectId::Sha1(self.bytes.try_into().expect("no bug in hash detection")), + } + } +} + +impl<'a> From<&'a [u8; SIZE_OF_SHA1_DIGEST]> for &'a oid { + fn from(v: &'a [u8; SIZE_OF_SHA1_DIGEST]) -> Self { + oid::from_bytes(v.as_ref()) + } +} + +impl fmt::Display for &oid { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + for b in self.as_bytes() { + write!(f, "{b:02x}")?; + } + Ok(()) + } +} + +impl PartialEq for &oid { + fn eq(&self, other: &ObjectId) -> bool { + *self == other.as_ref() + } +} + +/// Manually created from a version that uses a slice, and we forcefully try to convert it into a borrowed array of the desired size +/// Could be improved by fitting this into serde +/// Unfortunately the serde::Deserialize derive wouldn't work for borrowed arrays. +#[cfg(feature = "serde1")] +impl<'de: 'a, 'a> serde::Deserialize<'de> for &'a oid { + fn deserialize(deserializer: D) -> Result>::Error> + where + D: serde::Deserializer<'de>, + { + struct __Visitor<'de: 'a, 'a> { + marker: std::marker::PhantomData<&'a oid>, + lifetime: std::marker::PhantomData<&'de ()>, + } + impl<'de: 'a, 'a> serde::de::Visitor<'de> for __Visitor<'de, 'a> { + type Value = &'a oid; + fn expecting(&self, __formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Formatter::write_str(__formatter, "tuple struct Digest") + } + #[inline] + fn visit_newtype_struct<__E>(self, __e: __E) -> std::result::Result + where + __E: serde::Deserializer<'de>, + { + let __field0: &'a [u8] = match <&'a [u8] as serde::Deserialize>::deserialize(__e) { + Ok(__val) => __val, + Err(__err) => { + return Err(__err); + } + }; + Ok(oid::try_from_bytes(__field0).expect("hash of known length")) + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) -> std::result::Result + where + __A: serde::de::SeqAccess<'de>, + { + let __field0 = match match serde::de::SeqAccess::next_element::<&'a [u8]>(&mut __seq) { + Ok(__val) => __val, + Err(__err) => { + return Err(__err); + } + } { + Some(__value) => __value, + None => { + return Err(serde::de::Error::invalid_length( + 0usize, + &"tuple struct Digest with 1 element", + )); + } + }; + Ok(oid::try_from_bytes(__field0).expect("hash of known length")) + } + } + serde::Deserializer::deserialize_newtype_struct( + deserializer, + "Digest", + __Visitor { + marker: std::marker::PhantomData::<&'a oid>, + lifetime: std::marker::PhantomData, + }, + ) + } +} diff --git a/vendor/gix-hash/src/prefix.rs b/vendor/gix-hash/src/prefix.rs new file mode 100644 index 000000000..a8b55922e --- /dev/null +++ b/vendor/gix-hash/src/prefix.rs @@ -0,0 +1,152 @@ +use std::{cmp::Ordering, convert::TryFrom}; + +use crate::{oid, ObjectId, Prefix}; + +/// The error returned by [Prefix::new()]. +#[derive(Debug, thiserror::Error)] +#[allow(missing_docs)] +pub enum Error { + #[error( + "The minimum hex length of a short object id is {}, got {hex_len}", + Prefix::MIN_HEX_LEN + )] + TooShort { hex_len: usize }, + #[error("An object of kind {object_kind} cannot be larger than {} in hex, but {hex_len} was requested", object_kind.len_in_hex())] + TooLong { object_kind: crate::Kind, hex_len: usize }, +} + +/// +pub mod from_hex { + /// The error returned by [Prefix::from_hex][super::Prefix::from_hex()]. + #[derive(Debug, Eq, PartialEq, thiserror::Error)] + #[allow(missing_docs)] + pub enum Error { + #[error( + "The minimum hex length of a short object id is {}, got {hex_len}", + super::Prefix::MIN_HEX_LEN + )] + TooShort { hex_len: usize }, + #[error("An id cannot be larger than {} chars in hex, but {hex_len} was requested", crate::Kind::longest().len_in_hex())] + TooLong { hex_len: usize }, + #[error("Invalid character {c} at position {index}")] + Invalid { c: char, index: usize }, + } +} + +impl Prefix { + /// The smallest allowed prefix length below which chances for collisions are too high even in small repositories. + pub const MIN_HEX_LEN: usize = 4; + + /// Create a new instance by taking a full `id` as input and truncating it to `hex_len`. + /// + /// For instance, with `hex_len` of 7 the resulting prefix is 3.5 bytes, or 3 bytes and 4 bits + /// wide, with all other bytes and bits set to zero. + pub fn new(id: impl AsRef, hex_len: usize) -> Result { + let id = id.as_ref(); + if hex_len > id.kind().len_in_hex() { + Err(Error::TooLong { + object_kind: id.kind(), + hex_len, + }) + } else if hex_len < Self::MIN_HEX_LEN { + Err(Error::TooShort { hex_len }) + } else { + let mut prefix = ObjectId::null(id.kind()); + let b = prefix.as_mut_slice(); + let copy_len = (hex_len + 1) / 2; + b[..copy_len].copy_from_slice(&id.as_bytes()[..copy_len]); + if hex_len % 2 == 1 { + b[hex_len / 2] &= 0xf0; + } + + Ok(Prefix { bytes: prefix, hex_len }) + } + } + + /// Returns the prefix as object id. + /// + /// Note that it may be deceptive to use given that it looks like a full + /// object id, even though its post-prefix bytes/bits are set to zero. + pub fn as_oid(&self) -> &oid { + &self.bytes + } + + /// Return the amount of hexadecimal characters that are set in the prefix. + /// + /// This gives the prefix a granularity of 4 bits. + pub fn hex_len(&self) -> usize { + self.hex_len + } + + /// Provided with candidate id which is a full hash, determine how this prefix compares to it, + /// only looking at the prefix bytes, ignoring everything behind that. + pub fn cmp_oid(&self, candidate: &oid) -> Ordering { + let common_len = self.hex_len / 2; + + self.bytes.as_bytes()[..common_len] + .cmp(&candidate.as_bytes()[..common_len]) + .then(if self.hex_len % 2 == 1 { + let half_byte_idx = self.hex_len / 2; + self.bytes.as_bytes()[half_byte_idx].cmp(&(candidate.as_bytes()[half_byte_idx] & 0xf0)) + } else { + Ordering::Equal + }) + } + + /// Create an instance from the given hexadecimal prefix `value`, e.g. `35e77c16` would yield a `Prefix` with `hex_len()` = 8. + pub fn from_hex(value: &str) -> Result { + use hex::FromHex; + let hex_len = value.len(); + + if hex_len > crate::Kind::longest().len_in_hex() { + return Err(from_hex::Error::TooLong { hex_len }); + } else if hex_len < Self::MIN_HEX_LEN { + return Err(from_hex::Error::TooShort { hex_len }); + }; + + let src = if value.len() % 2 == 0 { + Vec::from_hex(value) + } else { + let mut buf = [0u8; crate::Kind::longest().len_in_hex()]; + buf[..value.len()].copy_from_slice(value.as_bytes()); + buf[value.len()] = b'0'; + Vec::from_hex(&buf[..value.len() + 1]) + } + .map_err(|e| match e { + hex::FromHexError::InvalidHexCharacter { c, index } => from_hex::Error::Invalid { c, index }, + hex::FromHexError::OddLength | hex::FromHexError::InvalidStringLength => panic!("This is already checked"), + })?; + + let mut bytes = ObjectId::null(crate::Kind::from_hex_len(value.len()).expect("hex-len is already checked")); + let dst = bytes.as_mut_slice(); + let copy_len = src.len(); + dst[..copy_len].copy_from_slice(&src); + + Ok(Prefix { bytes, hex_len }) + } +} + +/// Create an instance from the given hexadecimal prefix, e.g. `35e77c16` would yield a `Prefix` +/// with `hex_len()` = 8. +impl TryFrom<&str> for Prefix { + type Error = from_hex::Error; + + fn try_from(value: &str) -> Result { + Prefix::from_hex(value) + } +} + +impl std::fmt::Display for Prefix { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.bytes.to_hex_with_len(self.hex_len).fmt(f) + } +} + +impl From for Prefix { + fn from(oid: ObjectId) -> Self { + Prefix { + bytes: oid, + hex_len: oid.kind().len_in_hex(), + } + } +} -- cgit v1.2.3