-
-
Notifications
You must be signed in to change notification settings - Fork 409
Description
Summary 💡
As mentioned here the git-traverse crate only support non-ordered breadthfirst traversal.
https://github.com/Byron/gitoxide/blob/ff9e1571b558475e727dc6ba11dab24ef15fb6f4/git-repository/src/object/tree/traverse.rs#L47-L48
Motivation 🔦
I am building a git platform using gitoxide.
The tree explorer you can see in the screenshot below use the current breadth-first search traversal.
The current implementation works fine but needs to traverse the entire tree from root each time we load a page. An alternative would be to load the tree in order with a given depth to get only what needs to be rendered.
Example
. // root
├── one
│ ├── two // depth 1
│ │ └── blob // depth 2
│ └── tree // depth 1
│ ├── blob // depth 2
│ ├── blob // ..
│ ├── blob // ..
And this is the real life use case :

I have no idea if this is doable, I will try to implement it if you are ok with the idea.
Otherwise I will just cache everything :)