gitext-rs / git-stack

Stacked branch management for Git
Apache License 2.0
508 stars 19 forks source link

refactor(graph): Allow reducing recursion depth #115

Closed epage closed 2 years ago

epage commented 2 years ago

In prep for #90, this changes the data structure to allow iterating through the commit tree, rather than recursing.

This also updates most graph operations to use iteration. The main care about for stackoverflows is when handling protected commits (shared base between two long living branches), so that was the focus here. Some algorithms improved with this change. Some were difficult. Some would be very difficult and for those, I made it so we iterated through protected commits and kept recursion after that.

What this did not address