pcottle / learnGitBranching

An interactive git visualization and tutorial. Aspiring students of git can use this app to educate and challenge themselves towards mastery of git!
https://pcottle.github.io/learnGitBranching/
MIT License
30.34k stars 5.73k forks source link

updated undo command to only track when a command changes the tree #1087

Closed birdalicious closed 1 year ago

birdalicious commented 1 year ago

undo now only undo changing commands for example:

git commit (C1)
git commit (C2)
git log
git log
undo

will now revert the state of the tree back to C1 where as before each undo would correspond to a git log command first so you would need 3x undos.

This should have no affect on undos in levels as they override the sandbox behaviour and have their own logic for tracking if a command counts for golf (which seems to be the same condition only captured explicitly for each command)

netlify[bot] commented 1 year ago

Deploy Preview for xenodochial-hugle-b9ec84 ready!

Name Link
Latest commit 6258ed501e5b751d108b46ce70530ca9776811eb
Latest deploy log https://app.netlify.com/sites/xenodochial-hugle-b9ec84/deploys/64b6d9c1349cdd000850ef8b
Deploy Preview https://deploy-preview-1087--xenodochial-hugle-b9ec84.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

pcottle commented 1 year ago

👏 🥳🥳🥳🥳

Great idea and UX improvement! Thanks a ton for the pull request -- definitely agree this is much better than having to undo "past" commands that didn't change the git state.

Will push the site now