diff options
Diffstat (limited to 'vendor/gix-traverse')
-rw-r--r-- | vendor/gix-traverse/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/gix-traverse/CHANGELOG.md | 260 | ||||
-rw-r--r-- | vendor/gix-traverse/Cargo.toml | 26 | ||||
-rw-r--r-- | vendor/gix-traverse/src/commit.rs | 323 |
4 files changed, 516 insertions, 95 deletions
diff --git a/vendor/gix-traverse/.cargo-checksum.json b/vendor/gix-traverse/.cargo-checksum.json index 6f0922ec9..532b878a0 100644 --- a/vendor/gix-traverse/.cargo-checksum.json +++ b/vendor/gix-traverse/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"7374457e062d3eb3971926e3c3b72a00ba68a09ff88f3d46e6bddd5815d283c5","Cargo.toml":"645a082b95948cb6c4cf99973f706fd870f15f59baef3e5e7d922a449dbcf914","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"49df47913ab2beafe8dc45607877ae64198bf0eee64aaad3e82ed9e4d27424e8","src/commit.rs":"c5ea45bd879ba5366af3674db332a55f5400300eaf6d76bbefc895bd47b18aca","src/lib.rs":"e393d36a432571c44efd478739fb5ff6779b188618aac2058e1d45af809ecc54","src/tree/breadthfirst.rs":"399b898d3fd22e58601ed449f6c3fed6284350a467f7eabef8bbe51857ac6f0a","src/tree/mod.rs":"7d8c982aabf8b0cf4952fe542cd7623e17a171c2c689e141b5a711549c5e708f","src/tree/recorder.rs":"da18f92a15b76d886e57e10e586951287110cb8062ecff1f4c11195838eb2625"},"package":"b0842e984cb4bf26339dc559f3a1b8bf8cdb83547799b2b096822a59f87f33d9"}
\ No newline at end of file +{"files":{"CHANGELOG.md":"5d14e0cb429e00c1adec4b334b92cba631291f1e4109e1af0d1aabc1b78a8980","Cargo.toml":"4a6ab338aa87d52bf6f1baa1bcb6d3a7c9ae4f48f760344070a374336107a02c","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"49df47913ab2beafe8dc45607877ae64198bf0eee64aaad3e82ed9e4d27424e8","src/commit.rs":"75da6c4897140a844c7349bf505b46ea086dd588379f9b88d70ffef2aa997cd4","src/lib.rs":"e393d36a432571c44efd478739fb5ff6779b188618aac2058e1d45af809ecc54","src/tree/breadthfirst.rs":"399b898d3fd22e58601ed449f6c3fed6284350a467f7eabef8bbe51857ac6f0a","src/tree/mod.rs":"7d8c982aabf8b0cf4952fe542cd7623e17a171c2c689e141b5a711549c5e708f","src/tree/recorder.rs":"da18f92a15b76d886e57e10e586951287110cb8062ecff1f4c11195838eb2625"},"package":"22ef04ab3643acba289b5cedd25d6f53c0430770b1d689d1d654511e6fb81ba0"}
\ No newline at end of file diff --git a/vendor/gix-traverse/CHANGELOG.md b/vendor/gix-traverse/CHANGELOG.md index 1f989df86..58c9bf929 100644 --- a/vendor/gix-traverse/CHANGELOG.md +++ b/vendor/gix-traverse/CHANGELOG.md @@ -5,6 +5,261 @@ 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.33.0 (2023-09-24) + +A maintenance release without user-facing changes. + +### Commit Statistics + +<csr-read-only-do-not-edit/> + + - 1 commit contributed to the release. + - 16 days passed between releases. + - 0 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + +<csr-read-only-do-not-edit/> + +<details><summary>view details</summary> + + * **Uncategorized** + - Prepare changelogs prior to release ([`8a60d5b`](https://github.com/Byron/gitoxide/commit/8a60d5b80877c213c3b646d3061e8a33e0e433ec)) +</details> + +## 0.32.0 (2023-09-08) + +### Bug Fixes (BREAKING) + + - <csr-id-072ee32f693a31161cd6a843da6582d13efbb20b/> use `dyn` trait where possible. + This reduces compile time due to avoiding duplication. + +### Commit Statistics + +<csr-read-only-do-not-edit/> + + - 5 commits contributed to the release over the course of 17 calendar days. + - 17 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 + +<csr-read-only-do-not-edit/> + +<details><summary>view details</summary> + + * **Uncategorized** + - Release gix-date v0.8.0, gix-hash v0.13.0, gix-features v0.34.0, gix-actor v0.26.0, gix-object v0.36.0, gix-path v0.10.0, gix-glob v0.12.0, gix-attributes v0.18.0, gix-packetline-blocking v0.16.6, gix-filter v0.4.0, gix-fs v0.6.0, gix-commitgraph v0.20.0, gix-hashtable v0.4.0, gix-revwalk v0.7.0, gix-traverse v0.32.0, gix-worktree-stream v0.4.0, gix-archive v0.4.0, gix-config-value v0.14.0, gix-tempfile v9.0.0, gix-lock v9.0.0, gix-ref v0.36.0, gix-sec v0.10.0, gix-config v0.29.0, gix-prompt v0.7.0, gix-url v0.23.0, gix-credentials v0.19.0, gix-diff v0.35.0, gix-discover v0.24.0, gix-ignore v0.7.0, gix-index v0.24.0, gix-macros v0.1.0, gix-mailmap v0.18.0, gix-negotiate v0.7.0, gix-pack v0.42.0, gix-odb v0.52.0, gix-pathspec v0.2.0, gix-packetline v0.16.6, gix-transport v0.36.0, gix-protocol v0.39.0, gix-revision v0.21.0, gix-refspec v0.17.0, gix-submodule v0.3.0, gix-worktree v0.25.0, gix-worktree-state v0.2.0, gix v0.53.0, safety bump 39 crates ([`8bd0456`](https://github.com/Byron/gitoxide/commit/8bd045676bb2cdc02624ab93e73ff8518064ca38)) + - Prepare changelogs for release ([`375db06`](https://github.com/Byron/gitoxide/commit/375db06a8442378c3f7a922fae38e2a6694d9d04)) + - Merge branch `dyn`ification ([`f658fcc`](https://github.com/Byron/gitoxide/commit/f658fcc52dc2200ae34ca53dc10be97fb9012057)) + - Use `dyn` trait where possible. ([`072ee32`](https://github.com/Byron/gitoxide/commit/072ee32f693a31161cd6a843da6582d13efbb20b)) + - Merge branch 'gix-submodule' ([`363ee77`](https://github.com/Byron/gitoxide/commit/363ee77400805f473c9ad66eadad9214e7ab66f4)) +</details> + +## 0.31.0 (2023-08-22) + +<csr-id-229bd4899213f749a7cc124aa2b82a1368fba40f/> + +### Chore + + - <csr-id-229bd4899213f749a7cc124aa2b82a1368fba40f/> don't call crate 'WIP' in manifest anymore. + +### Commit Statistics + +<csr-read-only-do-not-edit/> + + - 8 commits contributed to the release over the course of 18 calendar days. + - 30 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 + +<csr-read-only-do-not-edit/> + +<details><summary>view details</summary> + + * **Uncategorized** + - Release gix-date v0.7.3, gix-hash v0.12.0, gix-features v0.33.0, gix-actor v0.25.0, gix-object v0.35.0, gix-path v0.9.0, gix-glob v0.11.0, gix-quote v0.4.7, gix-attributes v0.17.0, gix-command v0.2.9, gix-packetline-blocking v0.16.5, gix-filter v0.3.0, gix-fs v0.5.0, gix-commitgraph v0.19.0, gix-hashtable v0.3.0, gix-revwalk v0.6.0, gix-traverse v0.31.0, gix-worktree-stream v0.3.0, gix-archive v0.3.0, gix-config-value v0.13.0, gix-tempfile v8.0.0, gix-lock v8.0.0, gix-ref v0.35.0, gix-sec v0.9.0, gix-config v0.28.0, gix-prompt v0.6.0, gix-url v0.22.0, gix-credentials v0.18.0, gix-diff v0.34.0, gix-discover v0.23.0, gix-ignore v0.6.0, gix-bitmap v0.2.7, gix-index v0.22.0, gix-mailmap v0.17.0, gix-negotiate v0.6.0, gix-pack v0.41.0, gix-odb v0.51.0, gix-pathspec v0.1.0, gix-packetline v0.16.5, gix-transport v0.35.0, gix-protocol v0.38.0, gix-revision v0.20.0, gix-refspec v0.16.0, gix-submodule v0.2.0, gix-worktree v0.24.0, gix-worktree-state v0.1.0, gix v0.52.0, gitoxide-core v0.31.0, gitoxide v0.29.0, safety bump 41 crates ([`30b2761`](https://github.com/Byron/gitoxide/commit/30b27615047692d3ced1b2d9c2ac15a80f79fbee)) + - Update changelogs prior to release ([`f23ea88`](https://github.com/Byron/gitoxide/commit/f23ea8828f2d9ba7559973daca388c9591bcc5fc)) + - Merge branch 'gix-submodule' ([`8f3f358`](https://github.com/Byron/gitoxide/commit/8f3f358800f1fe77d7ba7ebd396a90b692d3c0c1)) + - More cleanup of test crates ([`73c685a`](https://github.com/Byron/gitoxide/commit/73c685a67debcfa26a940f37bbca69cb3a4af57e)) + - Don't call crate 'WIP' in manifest anymore. ([`229bd48`](https://github.com/Byron/gitoxide/commit/229bd4899213f749a7cc124aa2b82a1368fba40f)) + - Release gix-glob v0.10.2, gix-date v0.7.2, gix-validate v0.8.0, gix-object v0.34.0, gix-ref v0.34.0, gix-config v0.27.0, gix-commitgraph v0.18.2, gix-revwalk v0.5.0, gix-revision v0.19.0, gix-refspec v0.15.0, gix-submodule v0.1.0, safety bump 18 crates ([`4604f83`](https://github.com/Byron/gitoxide/commit/4604f83ef238dc07c85aaeae097399b67f3cfd0c)) + - Merge branch 'dev-on-linux' ([`6b4a303`](https://github.com/Byron/gitoxide/commit/6b4a30330fe49fc97daa73f55bf56580cc0597aa)) + - Fix various tests to run properly on linux ([`ef8ccd9`](https://github.com/Byron/gitoxide/commit/ef8ccd9d16143d37155d063747c69cade80f162d)) +</details> + +## 0.30.1 (2023-07-22) + +A maintenance release without user-facing changes. + +### Commit Statistics + +<csr-read-only-do-not-edit/> + + - 5 commits contributed to the release over the course of 1 calendar day. + - 3 days passed between releases. + - 0 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + +<csr-read-only-do-not-edit/> + +<details><summary>view details</summary> + + * **Uncategorized** + - Release gix-features v0.32.1, gix-actor v0.24.1, gix-validate v0.7.7, gix-object v0.33.1, gix-path v0.8.4, gix-glob v0.10.1, gix-quote v0.4.6, gix-attributes v0.16.0, gix-command v0.2.8, gix-packetline-blocking v0.16.4, gix-filter v0.2.0, gix-fs v0.4.1, gix-chunk v0.4.4, gix-commitgraph v0.18.1, gix-hashtable v0.2.4, gix-revwalk v0.4.1, gix-traverse v0.30.1, gix-worktree-stream v0.2.0, gix-archive v0.2.0, gix-config-value v0.12.5, gix-tempfile v7.0.1, gix-utils v0.1.5, gix-lock v7.0.2, gix-ref v0.33.1, gix-sec v0.8.4, gix-prompt v0.5.4, gix-url v0.21.1, gix-credentials v0.17.1, gix-diff v0.33.1, gix-discover v0.22.1, gix-ignore v0.5.1, gix-bitmap v0.2.6, gix-index v0.21.1, gix-mailmap v0.16.1, gix-negotiate v0.5.1, gix-pack v0.40.1, gix-odb v0.50.1, gix-packetline v0.16.4, gix-transport v0.34.1, gix-protocol v0.36.1, gix-revision v0.18.1, gix-refspec v0.14.1, gix-worktree v0.23.0, gix v0.50.0, safety bump 5 crates ([`16295b5`](https://github.com/Byron/gitoxide/commit/16295b58e2581d2e8b8b762816f52baabe871c75)) + - Prepare more changelogs ([`c4cc5f2`](https://github.com/Byron/gitoxide/commit/c4cc5f261d29f712a101033a18293a97a9d4ae85)) + - Release gix-date v0.7.1, gix-hash v0.11.4, gix-trace v0.1.3, gix-features v0.32.0, gix-actor v0.24.0, gix-validate v0.7.7, gix-object v0.33.0, gix-path v0.8.4, gix-glob v0.10.0, gix-quote v0.4.6, gix-attributes v0.15.0, gix-command v0.2.7, gix-packetline-blocking v0.16.3, gix-filter v0.1.0, gix-fs v0.4.0, gix-chunk v0.4.4, gix-commitgraph v0.18.0, gix-hashtable v0.2.4, gix-revwalk v0.4.0, gix-traverse v0.30.0, gix-worktree-stream v0.2.0, gix-archive v0.2.0, gix-config-value v0.12.4, gix-tempfile v7.0.1, gix-utils v0.1.5, gix-lock v7.0.2, gix-ref v0.33.0, gix-sec v0.8.4, gix-prompt v0.5.3, gix-url v0.21.0, gix-credentials v0.17.0, gix-diff v0.33.0, gix-discover v0.22.0, gix-ignore v0.5.0, gix-bitmap v0.2.6, gix-index v0.21.0, gix-mailmap v0.16.0, gix-negotiate v0.5.0, gix-pack v0.40.0, gix-odb v0.50.0, gix-packetline v0.16.4, gix-transport v0.34.0, gix-protocol v0.36.0, gix-revision v0.18.0, gix-refspec v0.14.0, gix-worktree v0.22.0, gix v0.49.1 ([`5cb3589`](https://github.com/Byron/gitoxide/commit/5cb3589b74fc5376e02cbfe151e71344e1c417fe)) + - Update changelogs prior to release ([`2fc66b5`](https://github.com/Byron/gitoxide/commit/2fc66b55097ed494b72d1af939ba5561f71fde97)) + - Update license field following SPDX 2.1 license expression standard ([`9064ea3`](https://github.com/Byron/gitoxide/commit/9064ea31fae4dc59a56bdd3a06c0ddc990ee689e)) +</details> + +## 0.30.0 (2023-07-19) + +A maintenance release without user-facing changes. + +### Commit Statistics + +<csr-read-only-do-not-edit/> + + - 4 commits contributed to the release. + - 19 days passed between releases. + - 0 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + +<csr-read-only-do-not-edit/> + +<details><summary>view details</summary> + + * **Uncategorized** + - Release gix-filter v0.1.0, gix-ignore v0.5.0, gix-revwalk v0.4.0, gix-traverse v0.30.0, gix-index v0.21.0, gix-mailmap v0.16.0, gix-negotiate v0.5.0, gix-pack v0.40.0, gix-odb v0.50.0, gix-transport v0.34.0, gix-protocol v0.36.0, gix-revision v0.18.0, gix-refspec v0.14.0, gix-worktree v0.22.0, gix v0.49.0 ([`4aca8c2`](https://github.com/Byron/gitoxide/commit/4aca8c2ae2ec588fb65ec4faa0c07c19d219569f)) + - Release gix-features v0.32.0, gix-actor v0.24.0, gix-glob v0.10.0, gix-attributes v0.15.0, gix-commitgraph v0.18.0, gix-config-value v0.12.4, gix-fs v0.4.0, gix-object v0.33.0, gix-ref v0.33.0, gix-config v0.26.0, gix-command v0.2.7, gix-url v0.21.0, gix-credentials v0.17.0, gix-diff v0.33.0, gix-discover v0.22.0, gix-filter v0.1.0, gix-ignore v0.5.0, gix-revwalk v0.4.0, gix-traverse v0.30.0, gix-index v0.21.0, gix-mailmap v0.16.0, gix-negotiate v0.5.0, gix-pack v0.40.0, gix-odb v0.50.0, gix-transport v0.34.0, gix-protocol v0.36.0, gix-revision v0.18.0, gix-refspec v0.14.0, gix-worktree v0.22.0, gix v0.49.0 ([`68ae3ff`](https://github.com/Byron/gitoxide/commit/68ae3ff9d642ec56f088a6a682a073dc16f4e8ca)) + - Adjust package versions (by cargo-smart-release) ([`c70e54f`](https://github.com/Byron/gitoxide/commit/c70e54f163c312c87753a506eeaad462e8579bfb)) + - Prepare changelogs prior to release ([`e4dded0`](https://github.com/Byron/gitoxide/commit/e4dded05138562f9737a7dcfb60570c55769486d)) +</details> + +## 0.29.0 (2023-06-29) + +### Bug Fixes + + - <csr-id-9cfc4aa318bc44c9e4310db7d3764b015472e1af/> use type for time consistently. + This will allow it to be changed more easily later. + +### Commit Statistics + +<csr-read-only-do-not-edit/> + + - 5 commits contributed to the release. + - 6 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 + +<csr-read-only-do-not-edit/> + +<details><summary>view details</summary> + + * **Uncategorized** + - Release gix-date v0.7.0, gix-trace v0.1.2, gix-actor v0.23.0, gix-commitgraph v0.17.1, gix-utils v0.1.4, gix-object v0.32.0, gix-ref v0.32.0, gix-config v0.25.0, gix-diff v0.32.0, gix-discover v0.21.0, gix-hashtable v0.2.3, gix-revwalk v0.3.0, gix-traverse v0.29.0, gix-index v0.20.0, gix-mailmap v0.15.0, gix-negotiate v0.4.0, gix-pack v0.39.0, gix-odb v0.49.0, gix-protocol v0.35.0, gix-revision v0.17.0, gix-refspec v0.13.0, gix-worktree v0.21.0, gix v0.48.0, safety bump 20 crates ([`27e8c18`](https://github.com/Byron/gitoxide/commit/27e8c18db5a9a21843381c116a8ed6d9f681b3f8)) + - Prepare changelogs prior to release ([`00f96fb`](https://github.com/Byron/gitoxide/commit/00f96fb3110a8f81a1bd0d74c757c15b8773c6f6)) + - Merge branch 'i64-times' ([`b407461`](https://github.com/Byron/gitoxide/commit/b407461d8991db67a5bdb2ab13f518f78a85ed40)) + - Adapt to changes in `gix-date` ([`fba45c6`](https://github.com/Byron/gitoxide/commit/fba45c68d57d5f73070a6949556a04187d42e427)) + - Use type for time consistently. ([`9cfc4aa`](https://github.com/Byron/gitoxide/commit/9cfc4aa318bc44c9e4310db7d3764b015472e1af)) +</details> + +## 0.28.0 (2023-06-22) + +### Changed (BREAKING) + + - <csr-id-e4e8ddc8b6e38df66fc0461280074f975d2ffd11/> rename `commit::Sorting::ByCommitTimeNewestFirstCutoffOlderThan {time_in_seconds_since_epoch}` to `seconds`. + This is possible now that there is a type for the time with that name. + +### Commit Statistics + +<csr-read-only-do-not-edit/> + + - 9 commits contributed to the release over the course of 11 calendar days. + - 12 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 + +<csr-read-only-do-not-edit/> + +<details><summary>view details</summary> + + * **Uncategorized** + - Release gix-date v0.6.0, gix-hash v0.11.3, gix-trace v0.1.1, gix-features v0.31.0, gix-actor v0.22.0, gix-path v0.8.2, gix-glob v0.9.0, gix-quote v0.4.5, gix-attributes v0.14.0, gix-chunk v0.4.3, gix-commitgraph v0.17.0, gix-config-value v0.12.2, gix-fs v0.3.0, gix-tempfile v7.0.0, gix-utils v0.1.3, gix-lock v7.0.0, gix-validate v0.7.6, gix-object v0.31.0, gix-ref v0.31.0, gix-sec v0.8.2, gix-config v0.24.0, gix-command v0.2.6, gix-prompt v0.5.2, gix-url v0.20.0, gix-credentials v0.16.0, gix-diff v0.31.0, gix-discover v0.20.0, gix-hashtable v0.2.2, gix-ignore v0.4.0, gix-bitmap v0.2.5, gix-revwalk v0.2.0, gix-traverse v0.28.0, gix-index v0.19.0, gix-mailmap v0.14.0, gix-negotiate v0.3.0, gix-pack v0.38.0, gix-odb v0.48.0, gix-packetline v0.16.3, gix-transport v0.33.0, gix-protocol v0.34.0, gix-revision v0.16.0, gix-refspec v0.12.0, gix-worktree v0.20.0, gix v0.47.0, gitoxide-core v0.29.0, gitoxide v0.27.0, safety bump 30 crates ([`ea9f942`](https://github.com/Byron/gitoxide/commit/ea9f9424e777f10da0e33bb9ffbbefd01c4c5a74)) + - Prepare changelogs prior to release ([`18b0a37`](https://github.com/Byron/gitoxide/commit/18b0a371941aa2d4d62512437d5daa351ba99ffd)) + - `just fmt` ([`871dd0b`](https://github.com/Byron/gitoxide/commit/871dd0b977caf17159092a4739ba5408403cdb2c)) + - Merge branch 'corpus' ([`aa16c8c`](https://github.com/Byron/gitoxide/commit/aa16c8ce91452a3e3063cf1cf0240b6014c4743f)) + - Change MSRV to 1.65 ([`4f635fc`](https://github.com/Byron/gitoxide/commit/4f635fc4429350bae2582d25de86429969d28f30)) + - Merge branch 'future-dates' ([`8d2e6a9`](https://github.com/Byron/gitoxide/commit/8d2e6a91ac92a033e9e3daad5cffa90263075536)) + - Rename `commit::Sorting::ByCommitTimeNewestFirstCutoffOlderThan {time_in_seconds_since_epoch}` to `seconds`. ([`e4e8ddc`](https://github.com/Byron/gitoxide/commit/e4e8ddc8b6e38df66fc0461280074f975d2ffd11)) + - Adapt to changes in `gix-actor` ([`4a80e86`](https://github.com/Byron/gitoxide/commit/4a80e868f9530896616e649838e9be64b6d10036)) + - Adapt to changes in `gix-date` ([`d575336`](https://github.com/Byron/gitoxide/commit/d575336c26e6026e463cd06d88266bb2bdd3e162)) +</details> + +## 0.27.0 (2023-06-10) + +### New Features + + - <csr-id-6c5c66e10550923941b3d22e862f0f3f26d7ba03/> `commit::Ancestors::with_commit_graph(graph)` to set and use a commitgraph. + That way, traversal speed is greatly improved for traversals that only need + access to parents and commit time, while still being more efficient if it + saves the caller to retrieve a commit again to parse it for parents. + +### New Features (BREAKING) + + - <csr-id-8d7b62736848841e0577aa0498eb39aec492a2fa/> `gix_traverse::commit::Ancestors` now returns rich commit information. + As part of the iteration, it will decode part of the commit and read parents and possibly + the commit time if time-based sorting is desired. These values will now be made available + instead of just the `id` of the commit. + + This saves the caller time to parse the commit again in case it needs similar information. + +### Bug Fixes (BREAKING) + + - <csr-id-affc9df48e7b7540a95e2d6024f05b391f38c8f0/> previously the commit-traversal sorted by date must have been wonky & rename `Sorting::Topological` to `Sorting::BreadthFirst`. + This is now fixed by using a proven data structure, the `BinaryHeap` as priority + queue. + + The rename is to differentiate `git log --topo-order` from what we are doing, which is actually quite + different. + +### Commit Statistics + +<csr-read-only-do-not-edit/> + + - 6 commits contributed to the release. + - 3 days passed between releases. + - 3 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + +<csr-read-only-do-not-edit/> + +<details><summary>view details</summary> + + * **Uncategorized** + - Release gix-attributes v0.13.1, gix-diff v0.30.1, gix-revwalk v0.1.0, gix-traverse v0.27.0, gix-index v0.18.0, gix-revision v0.15.2, gix-negotiate v0.2.1, gix-pack v0.37.0, gix-odb v0.47.0, gix-protocol v0.33.2, gix-worktree v0.19.0, gix v0.46.0, safety bump 7 crates ([`2560a2c`](https://github.com/Byron/gitoxide/commit/2560a2cc3e1d8c60cd812e15696fa4761d036e19)) + - Prepare changelogs prior to release ([`298f3d7`](https://github.com/Byron/gitoxide/commit/298f3d7359c5b183314d8c584e45dcdd559d88b3)) + - Merge branch 'walk-with-commitgraph' ([`fdee9a2`](https://github.com/Byron/gitoxide/commit/fdee9a22873a13ae644d3dc92f8fe93f8f0266c0)) + - `commit::Ancestors::with_commit_graph(graph)` to set and use a commitgraph. ([`6c5c66e`](https://github.com/Byron/gitoxide/commit/6c5c66e10550923941b3d22e862f0f3f26d7ba03)) + - Previously the commit-traversal sorted by date must have been wonky & rename `Sorting::Topological` to `Sorting::BreadthFirst`. ([`affc9df`](https://github.com/Byron/gitoxide/commit/affc9df48e7b7540a95e2d6024f05b391f38c8f0)) + - `gix_traverse::commit::Ancestors` now returns rich commit information. ([`8d7b627`](https://github.com/Byron/gitoxide/commit/8d7b62736848841e0577aa0498eb39aec492a2fa)) +</details> + ## 0.26.0 (2023-06-06) A maintenance release without user-facing changes. @@ -13,8 +268,8 @@ A maintenance release without user-facing changes. <csr-read-only-do-not-edit/> - - 11 commits contributed to the release over the course of 25 calendar days. - - 40 days passed between releases. + - 12 commits contributed to the release over the course of 25 calendar days. + - 41 days passed between releases. - 0 commits were understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' were seen in commit messages @@ -25,6 +280,7 @@ A maintenance release without user-facing changes. <details><summary>view details</summary> * **Uncategorized** + - Release gix-date v0.5.1, gix-hash v0.11.2, gix-features v0.30.0, gix-actor v0.21.0, gix-path v0.8.1, gix-glob v0.8.0, gix-quote v0.4.4, gix-attributes v0.13.0, gix-chunk v0.4.2, gix-commitgraph v0.16.0, gix-config-value v0.12.1, gix-fs v0.2.0, gix-tempfile v6.0.0, gix-utils v0.1.2, gix-lock v6.0.0, gix-validate v0.7.5, gix-object v0.30.0, gix-ref v0.30.0, gix-sec v0.8.1, gix-config v0.23.0, gix-command v0.2.5, gix-prompt v0.5.1, gix-url v0.19.0, gix-credentials v0.15.0, gix-diff v0.30.0, gix-discover v0.19.0, gix-hashtable v0.2.1, gix-ignore v0.3.0, gix-bitmap v0.2.4, gix-traverse v0.26.0, gix-index v0.17.0, gix-mailmap v0.13.0, gix-revision v0.15.0, gix-negotiate v0.2.0, gix-pack v0.36.0, gix-odb v0.46.0, gix-packetline v0.16.2, gix-transport v0.32.0, gix-protocol v0.33.0, gix-refspec v0.11.0, gix-worktree v0.18.0, gix v0.45.0, safety bump 29 crates ([`9a9fa96`](https://github.com/Byron/gitoxide/commit/9a9fa96fa8a722bddc5c3b2270b0edf8f6615141)) - Prepare changelogs prior to release ([`8f15cec`](https://github.com/Byron/gitoxide/commit/8f15cec1ec7d5a9d56bb158f155011ef2bb3539b)) - Merge pull request #878 from blinxen/main ([`67da689`](https://github.com/Byron/gitoxide/commit/67da6894c8d8a24b982c732a1753a3e0a3300cc3)) - Include missing changelog file in some crates ([`0269eed`](https://github.com/Byron/gitoxide/commit/0269eedc08c21589b5381d9b7d7fcc7004160bf8)) diff --git a/vendor/gix-traverse/Cargo.toml b/vendor/gix-traverse/Cargo.toml index e8a111b17..3efde7153 100644 --- a/vendor/gix-traverse/Cargo.toml +++ b/vendor/gix-traverse/Cargo.toml @@ -11,9 +11,9 @@ [package] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" name = "gix-traverse" -version = "0.26.0" +version = "0.33.0" authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"] include = [ "src/**/*", @@ -21,21 +21,33 @@ include = [ "CHANGELOG.md", ] autotests = false -description = "A WIP crate of the gitoxide project" -license = "MIT/Apache-2.0" +description = "A crate of the gitoxide project" +license = "MIT OR Apache-2.0" repository = "https://github.com/Byron/gitoxide" [lib] doctest = false +[dependencies.gix-commitgraph] +version = "^0.21.0" + +[dependencies.gix-date] +version = "^0.8.0" + [dependencies.gix-hash] -version = "^0.11.2" +version = "^0.13.0" [dependencies.gix-hashtable] -version = "^0.2.1" +version = "^0.4.0" [dependencies.gix-object] -version = "^0.30.0" +version = "^0.37.0" + +[dependencies.gix-revwalk] +version = "^0.8.0" + +[dependencies.smallvec] +version = "1.10.0" [dependencies.thiserror] version = "1.0.32" diff --git a/vendor/gix-traverse/src/commit.rs b/vendor/gix-traverse/src/commit.rs index 95d48842a..29f5947b3 100644 --- a/vendor/gix-traverse/src/commit.rs +++ b/vendor/gix-traverse/src/commit.rs @@ -1,6 +1,9 @@ +use smallvec::SmallVec; + /// An iterator over the ancestors one or more starting commits pub struct Ancestors<Find, Predicate, StateMut> { find: Find, + cache: Option<gix_commitgraph::Graph>, predicate: Predicate, state: StateMut, parents: Parents, @@ -18,15 +21,36 @@ pub enum Parents { } /// Specify how to sort commits during traversal. +/// +/// ### Sample History +/// +/// The following history will be referred to for explaining how the sort order works, with the number denoting the commit timestamp +/// (*their X-alignment doesn't matter*). +/// +/// ```text +/// ---1----2----4----7 <- second parent of 8 +/// \ \ +/// 3----5----6----8--- +/// ``` + #[derive(Default, Debug, Copy, Clone)] pub enum Sorting { /// Commits are sorted as they are mentioned in the commit graph. + /// + /// In the *sample history* the order would be `8, 6, 7, 5, 4, 3, 2, 1` + /// + /// ### Note + /// + /// This is not to be confused with `git log/rev-list --topo-order`, which is notably different from + /// as it avoids overlapping branches. #[default] - Topological, + BreadthFirst, /// Commits are sorted by their commit time in descending order, that is newest first. /// /// The sorting applies to all currently queued commit ids and thus is full. /// + /// In the *sample history* the order would be `8, 7, 6, 5, 4, 3, 2, 1` + /// /// # Performance /// /// This mode benefits greatly from having an object_cache in `find()` @@ -36,25 +60,45 @@ pub enum Sorting { /// a given time, stopping the iteration once no younger commits is queued to be traversed. /// /// As the query is usually repeated with different cutoff dates, this search mode benefits greatly from an object cache. + /// + /// In the *sample history* and a cut-off date of 4, the returned list of commits would be `8, 7, 6, 4` ByCommitTimeNewestFirstCutoffOlderThan { /// The amount of seconds since unix epoch, the same value obtained by any `gix_date::Time` structure and the way git counts time. - time_in_seconds_since_epoch: u32, + seconds: gix_date::SecondsSinceUnixEpoch, }, } +/// The collection of parent ids we saw as part of the iteration. +/// +/// Note that this list is truncated if [`Parents::First`] was used. +pub type ParentIds = SmallVec<[gix_hash::ObjectId; 1]>; + +/// Information about a commit that we obtained naturally as part of the iteration. +#[derive(Debug, Clone, PartialEq, Eq, Ord, PartialOrd, Hash)] +pub struct Info { + /// The id of the commit. + pub id: gix_hash::ObjectId, + /// All parent ids we have encountered. Note that these will be at most one if [`Parents::First`] is enabled. + pub parent_ids: ParentIds, + /// The time at which the commit was created. It's only `Some(_)` if sorting is not [`Sorting::BreadthFirst`], as the walk + /// needs to require the commit-date. + pub commit_time: Option<gix_date::SecondsSinceUnixEpoch>, +} + /// pub mod ancestors { use std::{ borrow::{Borrow, BorrowMut}, collections::VecDeque, - iter::FromIterator, }; + use gix_date::SecondsSinceUnixEpoch; use gix_hash::{oid, ObjectId}; use gix_hashtable::HashSet; use gix_object::CommitRefIter; + use smallvec::SmallVec; - use crate::commit::{Ancestors, Parents, Sorting}; + use crate::commit::{collect_parents, Ancestors, Either, Info, ParentIds, Parents, Sorting}; /// The error is part of the item returned by the [Ancestors] iterator. #[derive(Debug, thiserror::Error)] @@ -69,35 +113,40 @@ pub mod ancestors { ObjectDecode(#[from] gix_object::decode::Error), } - type TimeInSeconds = u32; - /// The state used and potentially shared by multiple graph traversals. - #[derive(Default, Clone)] + #[derive(Clone)] pub struct State { - next: VecDeque<(ObjectId, TimeInSeconds)>, + next: VecDeque<ObjectId>, + queue: gix_revwalk::PriorityQueue<SecondsSinceUnixEpoch, ObjectId>, buf: Vec<u8>, seen: HashSet<ObjectId>, parents_buf: Vec<u8>, + parent_ids: SmallVec<[(ObjectId, SecondsSinceUnixEpoch); 2]>, + } + + impl Default for State { + fn default() -> Self { + State { + next: Default::default(), + queue: gix_revwalk::PriorityQueue::new(), + buf: vec![], + seen: Default::default(), + parents_buf: vec![], + parent_ids: Default::default(), + } + } } impl State { fn clear(&mut self) { self.next.clear(); + self.queue.clear(); self.buf.clear(); self.seen.clear(); } } /// Builder - impl<Find, Predicate, StateMut> Ancestors<Find, Predicate, StateMut> { - /// Change our commit parent handling mode to the given one. - pub fn parents(mut self, mode: Parents) -> Self { - self.parents = mode; - self - } - } - - /// Builder impl<Find, Predicate, StateMut, E> Ancestors<Find, Predicate, StateMut> where Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Result<CommitRefIter<'a>, E>, @@ -107,32 +156,61 @@ pub mod ancestors { /// Set the sorting method, either topological or by author date pub fn sorting(mut self, sorting: Sorting) -> Result<Self, Error> { self.sorting = sorting; - if !matches!(self.sorting, Sorting::Topological) { - let mut cutoff_time_storage = self.sorting.cutoff_time().map(|cot| (cot, Vec::new())); - let state = self.state.borrow_mut(); - for (commit_id, commit_time) in &mut state.next { - let commit_iter = (self.find)(commit_id, &mut state.buf).map_err(|err| Error::FindExisting { - oid: *commit_id, - source: err.into(), - })?; - let time = commit_iter.committer()?.time.seconds_since_unix_epoch; - match &mut cutoff_time_storage { - Some((cutoff_time, storage)) if time >= *cutoff_time => { - storage.push((*commit_id, time)); + match self.sorting { + Sorting::BreadthFirst => { + self.queue_to_vecdeque(); + } + Sorting::ByCommitTimeNewestFirst | Sorting::ByCommitTimeNewestFirstCutoffOlderThan { .. } => { + let cutoff_time = self.sorting.cutoff_time(); + let state = self.state.borrow_mut(); + for commit_id in state.next.drain(..) { + let commit_iter = + (self.find)(&commit_id, &mut state.buf).map_err(|err| Error::FindExisting { + oid: commit_id, + source: err.into(), + })?; + let time = commit_iter.committer()?.time.seconds; + match cutoff_time { + Some(cutoff_time) if time >= cutoff_time => { + state.queue.insert(time, commit_id); + } + Some(_) => {} + None => { + state.queue.insert(time, commit_id); + } } - Some(_) => {} - None => *commit_time = time, } } - let mut v = match cutoff_time_storage { - Some((_, storage)) => storage, - None => Vec::from_iter(std::mem::take(&mut state.next).into_iter()), - }; - v.sort_by(|a, b| a.1.cmp(&b.1).reverse()); - state.next = v.into(); } Ok(self) } + + /// Change our commit parent handling mode to the given one. + pub fn parents(mut self, mode: Parents) -> Self { + self.parents = mode; + if matches!(self.parents, Parents::First) { + self.queue_to_vecdeque(); + } + self + } + + /// Set the commitgraph as `cache` to greatly accelerate any traversal. + /// + /// The cache will be used if possible, but we will fall-back without error to using the object + /// database for commit lookup. If the cache is corrupt, we will fall back to the object database as well. + pub fn commit_graph(mut self, cache: Option<gix_commitgraph::Graph>) -> Self { + self.cache = cache; + self + } + + fn queue_to_vecdeque(&mut self) { + let state = self.state.borrow_mut(); + state.next.extend( + std::mem::replace(&mut state.queue, gix_revwalk::PriorityQueue::new()) + .into_iter_unordered() + .map(|(_time, id)| id), + ); + } } /// Initialization @@ -191,12 +269,13 @@ pub mod ancestors { for tip in tips.map(Into::into) { let was_inserted = state.seen.insert(tip); if was_inserted && predicate(&tip) { - state.next.push_back((tip, 0)); + state.next.push_back(tip); } } } Self { find, + cache: None, predicate, state, parents: Default::default(), @@ -213,6 +292,11 @@ pub mod ancestors { pub fn commit_iter(&self) -> CommitRefIter<'_> { CommitRefIter::from_bytes(&self.state.borrow().buf) } + + /// Return the current commits data. + pub fn commit_data(&self) -> &[u8] { + &self.state.borrow().buf + } } impl<Find, Predicate, StateMut, E> Iterator for Ancestors<Find, Predicate, StateMut> @@ -222,18 +306,18 @@ pub mod ancestors { StateMut: BorrowMut<State>, E: std::error::Error + Send + Sync + 'static, { - type Item = Result<ObjectId, Error>; + type Item = Result<Info, Error>; fn next(&mut self) -> Option<Self::Item> { if matches!(self.parents, Parents::First) { self.next_by_topology() } else { match self.sorting { - Sorting::Topological => self.next_by_topology(), + Sorting::BreadthFirst => self.next_by_topology(), Sorting::ByCommitTimeNewestFirst => self.next_by_commit_date(None), - Sorting::ByCommitTimeNewestFirstCutoffOlderThan { - time_in_seconds_since_epoch, - } => self.next_by_commit_date(time_in_seconds_since_epoch.into()), + Sorting::ByCommitTimeNewestFirstCutoffOlderThan { seconds } => { + self.next_by_commit_date(seconds.into()) + } } } } @@ -241,11 +325,9 @@ pub mod ancestors { impl Sorting { /// If not topo sort, provide the cutoff date if present. - fn cutoff_time(&self) -> Option<u32> { + fn cutoff_time(&self) -> Option<SecondsSinceUnixEpoch> { match self { - Sorting::ByCommitTimeNewestFirstCutoffOlderThan { - time_in_seconds_since_epoch, - } => Some(*time_in_seconds_since_epoch), + Sorting::ByCommitTimeNewestFirstCutoffOlderThan { seconds } => Some(*seconds), _ => None, } } @@ -259,53 +341,53 @@ pub mod ancestors { StateMut: BorrowMut<State>, E: std::error::Error + Send + Sync + 'static, { - fn next_by_commit_date(&mut self, cutoff_older_than: Option<TimeInSeconds>) -> Option<Result<ObjectId, Error>> { + fn next_by_commit_date( + &mut self, + cutoff_older_than: Option<SecondsSinceUnixEpoch>, + ) -> Option<Result<Info, Error>> { let state = self.state.borrow_mut(); - let (oid, _commit_time) = state.next.pop_front()?; - match (self.find)(&oid, &mut state.buf) { - Ok(commit_iter) => { - let mut count = 0; + let (commit_time, oid) = state.queue.pop()?; + let mut parents: ParentIds = Default::default(); + match super::find(self.cache.as_ref(), &mut self.find, &oid, &mut state.buf) { + Ok(Either::CachedCommit(commit)) => { + if !collect_parents(&mut state.parent_ids, self.cache.as_ref(), commit.iter_parents()) { + // drop corrupt caches and try again with ODB + self.cache = None; + return self.next_by_commit_date(cutoff_older_than); + } + for (id, parent_commit_time) in state.parent_ids.drain(..) { + parents.push(id); + let was_inserted = state.seen.insert(id); + if !(was_inserted && (self.predicate)(&id)) { + continue; + } + + match cutoff_older_than { + Some(cutoff_older_than) if parent_commit_time < cutoff_older_than => continue, + Some(_) | None => state.queue.insert(parent_commit_time, id), + } + } + } + Ok(Either::CommitRefIter(commit_iter)) => { for token in commit_iter { - count += 1; - let is_first = count == 1; match token { Ok(gix_object::commit::ref_iter::Token::Tree { .. }) => continue, Ok(gix_object::commit::ref_iter::Token::Parent { id }) => { + parents.push(id); let was_inserted = state.seen.insert(id); if !(was_inserted && (self.predicate)(&id)) { - if is_first && matches!(self.parents, Parents::First) { - break; - } else { - continue; - } + continue; } let parent = (self.find)(id.as_ref(), &mut state.parents_buf).ok(); let parent_commit_time = parent - .and_then(|parent| { - parent - .committer() - .ok() - .map(|committer| committer.time.seconds_since_unix_epoch) - }) + .and_then(|parent| parent.committer().ok().map(|committer| committer.time.seconds)) .unwrap_or_default(); - let pos = match state.next.binary_search_by(|c| c.1.cmp(&parent_commit_time).reverse()) - { - Ok(_) => None, - Err(pos) => Some(pos), - }; match cutoff_older_than { Some(cutoff_older_than) if parent_commit_time < cutoff_older_than => continue, - Some(_) | None => match pos { - Some(pos) => state.next.insert(pos, (id, parent_commit_time)), - None => state.next.push_back((id, parent_commit_time)), - }, - } - - if is_first && matches!(self.parents, Parents::First) { - break; + Some(_) | None => state.queue.insert(parent_commit_time, id), } } Ok(_unused_token) => break, @@ -320,7 +402,11 @@ pub mod ancestors { })) } } - Some(Ok(oid)) + Some(Ok(Info { + id: oid, + parent_ids: parents, + commit_time: Some(commit_time), + })) } } @@ -332,18 +418,38 @@ pub mod ancestors { StateMut: BorrowMut<State>, E: std::error::Error + Send + Sync + 'static, { - fn next_by_topology(&mut self) -> Option<Result<ObjectId, Error>> { + fn next_by_topology(&mut self) -> Option<Result<Info, Error>> { let state = self.state.borrow_mut(); - let (oid, _commit_time) = state.next.pop_front()?; - match (self.find)(&oid, &mut state.buf) { - Ok(commit_iter) => { + let oid = state.next.pop_front()?; + let mut parents: ParentIds = Default::default(); + match super::find(self.cache.as_ref(), &mut self.find, &oid, &mut state.buf) { + Ok(Either::CachedCommit(commit)) => { + if !collect_parents(&mut state.parent_ids, self.cache.as_ref(), commit.iter_parents()) { + // drop corrupt caches and try again with ODB + self.cache = None; + return self.next_by_topology(); + } + + for (id, _commit_time) in state.parent_ids.drain(..) { + parents.push(id); + let was_inserted = state.seen.insert(id); + if was_inserted && (self.predicate)(&id) { + state.next.push_back(id); + } + if matches!(self.parents, Parents::First) { + break; + } + } + } + Ok(Either::CommitRefIter(commit_iter)) => { for token in commit_iter { match token { Ok(gix_object::commit::ref_iter::Token::Tree { .. }) => continue, Ok(gix_object::commit::ref_iter::Token::Parent { id }) => { + parents.push(id); let was_inserted = state.seen.insert(id); if was_inserted && (self.predicate)(&id) { - state.next.push_back((id, 0)); + state.next.push_back(id); } if matches!(self.parents, Parents::First) { break; @@ -361,7 +467,54 @@ pub mod ancestors { })) } } - Some(Ok(oid)) + Some(Ok(Info { + id: oid, + parent_ids: parents, + commit_time: None, + })) } } } + +enum Either<'buf, 'cache> { + CommitRefIter(gix_object::CommitRefIter<'buf>), + CachedCommit(gix_commitgraph::file::Commit<'cache>), +} + +fn collect_parents( + dest: &mut SmallVec<[(gix_hash::ObjectId, gix_date::SecondsSinceUnixEpoch); 2]>, + cache: Option<&gix_commitgraph::Graph>, + parents: gix_commitgraph::file::commit::Parents<'_>, +) -> bool { + dest.clear(); + let cache = cache.as_ref().expect("parents iter is available, backed by `cache`"); + for parent_id in parents { + match parent_id { + Ok(pos) => dest.push({ + let parent = cache.commit_at(pos); + ( + parent.id().to_owned(), + parent.committer_timestamp() as gix_date::SecondsSinceUnixEpoch, // we can't handle errors here and trying seems overkill + ) + }), + Err(_err) => return false, + } + } + true +} + +fn find<'cache, 'buf, Find, E>( + cache: Option<&'cache gix_commitgraph::Graph>, + mut find: Find, + id: &gix_hash::oid, + buf: &'buf mut Vec<u8>, +) -> Result<Either<'buf, 'cache>, E> +where + Find: for<'a> FnMut(&gix_hash::oid, &'a mut Vec<u8>) -> Result<gix_object::CommitRefIter<'a>, E>, + E: std::error::Error + Send + Sync + 'static, +{ + match cache.and_then(|cache| cache.commit_by_id(id).map(Either::CachedCommit)) { + Some(c) => Ok(c), + None => find(id, buf).map(Either::CommitRefIter), + } +} |