When many changes are fast-forwarded, there is no need to make any IO at all - just pass through steps until you meet the one needing real action.
To perform this:
add "outdated" flag to state, and make reset as soon as you meet the state needing real actions
add HEAD to state, fill it at initializations and resets
(hint: when you make real commits, you shouldn't need to chack HEAD, because it's guaranteed to be new)
use the HEAD to make fast-forwards
PS: also probably it makes sense to try to reuse trees where possible, but that is completely different story
When many changes are fast-forwarded, there is no need to make any IO at all - just pass through steps until you meet the one needing real action.
To perform this:
PS: also probably it makes sense to try to reuse trees where possible, but that is completely different story