-
-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support equivalent of GIT_SORT_REVERSE | GIT_SORT_TOPOLOGICAL
in rev walk
#807
Comments
After having looked at the source code of As Rust has combinators for this I believe these should be used instead to not hide potentially considerable latency and memory consumption behind a seemingly innocent flag. Thanks for your understanding. |
Good point - thank you 🙏 |
would it be possible to implement this more performantly by implementing DoubleEndedIterator for a Walk? My use-case is that I want to quickly calculate the origin commit (the oldest commit with no parents) as quickly as possible. If the iterator over a Walk sorted by commit time were efficiently reversible, this would essential be O(1) instead of O(n) as it is now to call last() |
I believe with #1610 this would now be possible, without hurting performance, although its not for Topological searches, it is extremely fast when looking for ancient commits compared to the NewestFirst variants. |
Thanks for making this happen! I wasn't aware that simply traversing by oldest first can mean such a huge saving, and is definitely something that should be made available. |
Summary 💡
There's
gix_traverse::commit::Sorting::Topological
, but I haven't found a way to reverse the traversalMotivation 🔦
Used during filtering in https://github.com/josh-project/josh/
The text was updated successfully, but these errors were encountered: