5 ms·
What do you mean by idempotent? Clicking undo two times and going back only one step sounds confusing.
by diffeomorphism 4y ago
What do you mean by idempotent? Clicking undo two times and going back only one step sounds confusing.
- est 4y ago> What do you mean by idempotent? For every git command, provide a way to undo the previous command, if possible. For example, `git checkout -b abc`, a `git undo` would execute `git branch -D abc`. This is just an example, I know you can find many problems and with this approach and edge cases when it doesn't work, but we can make life easier for beginners in most cases. > Clicking undo two times and going back only one step Huh? I never meant that. Click undo two times would go back two steps, naturally. But of course, there are some actions that can't undo, so give user a warning or something.
- diffeomorphism 4y agohttps://www.merriam-webster.com/dictionary/idempotent https://www.merriam-webster.com/dictionary/idempotent idempotent means that doing it twice gives the same result as doing it once. So it seems you meant a different word?
- est 4y agoYes I mean undo would always restore the git to a previous state no matter what kind of commands you typed (best effort). It's perfectly symmetrical forward and backward operation which will guarantee restore to the same repo result whether you misstep git once or multiple times. Is there a better word to describe this? I am an ESL speaker.
- Xelbair 4y agoI suppose they meant that (most) git commands should be idempotent, and therefore easily reversible.
- diffeomorphism 4y agoBeing idempotent does not help much with invertibility, e.g. zeroing out a file is idempotent. In any case, the above post makes sense if you just delete the word.
- forgotpwd16 4y agoLess confusing than undo/redo on Emacs. Wanna redo? Just undo your undo after breaking your undo sequence. You broke your undo sequence and want to resume undoing but not redo? Just `M-x undo-only`. What if then only the reverse and just want to redo? Just `Mx undo-redo`. Also keep in mind that if you have some region selected undo only applies to the region rather the file. Unless you use C-/ which always operates on the buffer. It's without doubt powerful. But hell it's confusing.
- diffeomorphism 4y ago> emacs I found undo-tree incredibly intuitive.