max630 / git-rehi

git-rehi, history editor
https://github.com/max630/git-rehi/wiki
GNU General Public License v2.0
3 stars 0 forks source link

Optimize: fastforward over range withou any IO #24

Closed max630 closed 10 years ago

max630 commented 10 years ago

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:

  1. add "outdated" flag to state, and make reset as soon as you meet the state needing real actions
  2. 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)
  3. 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

max630 commented 10 years ago

Implemented