Live data from Hacker News

Why is it so hard to see code from 5 minutes ago?

web.eecs.utk.edu

1–10 of 424 posts

Re: Why is it so hard to see code from 5 minutes ago?

#4
Vim has time-based undo which is great, but I always forget about it and need to look up how to use it the few times that I want it.

Having a slider/timeline does sound like an excellent idea. Also just being able to non-destructively go back to a previous state and have a peak without changing the files I'm working on right now would would really well for me I think.

Of course git is an answer to this, but I don't want to think about making a checkpoint.

Re: Why is it so hard to see code from 5 minutes ago?

#5
In Vim you can achieve something quite similar with gundo plugin. Vim tracks all your changes in a tree by default and you can also use the "earlier" and "later" commands with a time delta to go back and forward a specified amount of time. So in Vim, to see the state of the file 5 minutes ago, you type ":earlier 5m" . Gundo is a visualisation on top of the builtin undo. I'm sure Emacs has something similar and probably more powerful, but I'm not familiar with it. I'm not aware of other editors having tree undo.

Re: Why is it so hard to see code from 5 minutes ago?

#6
For anyone that uses emacs, there is an excellent plugin "undo-tree" that solves this problem in a slightly different way. Everytime you undo a series of actions and then perform a new action, it creates a branch in the "tree". You can then visualize the tree and move through it quickly your entire buffer history.

Re: Why is it so hard to see code from 5 minutes ago?

#7
post #2

jetbrains IDEs have a local history feature that seems to do this

When I looked, it had the same problem that Dropbox has with this: a textual listing with only timestamps. I need semantic info! Show me the differences. Don't make me choose from this arbitrary list. I want to scan through the versions very, very quickly.

Re: Why is it so hard to see code from 5 minutes ago?

#8
post #5

In Vim you can achieve something quite similar with gundo plugin. Vim tracks all your changes in a tree by default and you can also use the "earlier" and "later" commands with a time delta to go back and forward a specified amount of time. So in Vim, to see the state of the file 5 minutes ago, you type ":earlier 5m" . Gundo is a visualisation on top of the builtin undo. I'm sure Emacs has something similar and probab…

Emacs does indeed have a plugin for this called "undo-tree". I think it is missing the ability to specify a time to go back by, but you can view the timestamps in the tree visualization.

Re: Why is it so hard to see code from 5 minutes ago?

#10
post #7
post #2

jetbrains IDEs have a local history feature that seems to do this

When I looked, it had the same problem that Dropbox has with this: a textual listing with only timestamps. I need semantic info! Show me the differences. Don't make me choose from this arbitrary list. I want to scan through the versions very, very quickly.

Not sure what you're looking at, but IntelliJ 2020.3 gives me a list w/ timestamps in 1/3 of the modal, then a diff viewer in the other 2/3. I can down-arrow through the versions and the diff updates.
Post reply on HN