Please don't make me use a slider. IntelliJ has local history, and I have that instinct to Cmd-S after every change. Problem already solved.
Why is it so hard to see code from 5 minutes ago?
121–130 of 424 posts
Re: Why is it so hard to see code from 5 minutes ago?
#122> I'll walk through some reasons why version control does not save the day here. While a developer is making changes to code, they may not realize that they want some intermediate version from a few minutes ago until they are well into making the change and become stuck. We saw this repeatedly in our studies. This introduces a problem of premature commitment3, which forces the developer to decide to save an intermedi…
> The obvious challenges seem to be managing temp-branch vs. “real” current branch state in a way that doesn't mess up or get messed up by other tools interacting with the repo (including ha sling things like pulls and other inbound changes to your “real” active branch), and generating non-noise automated commit messages. Low-level plumbing commands, if the VCS has them, can help with that, e. g. `git commit-tree`.
Re: Why is it so hard to see code from 5 minutes ago?
#123Reading the comments, I'm stunned and disillusioned. Are most modern developers struggling to write code without this? If so, there is a fundamental problem that has nothing to do with levels of undo.
If I'm reading this correctly it means applying a large number of undos to get to a previous editor state, followed by an equally large number of redos to then get back to where you started.
I can't recall every doing something like this.
The only time I seem to use undo is when I genuinely make some sort of editing mistake.
One reason I know I don't subconsciously do this is because I never struggle to execute an undo action.
However, on the rare occasions I need to do a redo I tend to struggle with the short cut key and usually go to the menu instead.
That tells me I use undo much more than redo.
Re: Why is it so hard to see code from 5 minutes ago?
#124Re: Why is it so hard to see code from 5 minutes ago?
#125I only use it when experimenting with different approaches.
Mostly I only use the "Local Changes" tab in the Git panel that shows the diff compared to the last commit, or "Compare with branch" to see the overall changes relative to the base branch.
Re: Why is it so hard to see code from 5 minutes ago?
#126jetbrains IDEs have a local history feature that seems to do this
Re: Why is it so hard to see code from 5 minutes ago?
#127Oh hey, I've built this! My version would watch code files and snapshot a diff every few seconds. It took a little work to tweak the constants to keep the watching performant, but it was super neat being able to replay code. The main problem I faced was that changes often occur in different places in the file, so the history replaying jumps around a lot. With some proper editor integration, I could see it being prett…
Until this point I thought that was just a bad practice on my end, so never saw the need/opportunity for something like a state slider.
Honestly never thought other people were using undo/redo like this.
Re: Why is it so hard to see code from 5 minutes ago?
#128Earlier quoted context omitted.
Commit early, Commit often!
If I have to commit my whole undo history then I’m using git very wrong. I commit (even temporarily) to save progress, but only when it makes sense to so. Sometimes I don’t know whether I’ll need this specific version again in the future.
Re: Why is it so hard to see code from 5 minutes ago?
#129Earlier quoted context omitted.
Likewise. This whole thread is totally bizarre. The closest imaginable thing I might do is wrapping some block of code in an if(false) {..} or #ifdef it out, when I'm refactoring and feeling unsure about my changes. But is that even the same thing that we're talking about here?
Hello from the bizarro universe of people who do this all the time and can't imagine the opposite. Do you never rewrite some code only to realize it didn't precisely capture all the edge cases of the thing you rewrote? In those cases I use the git gutter in VSCode to view what the old code looked like and compare and contrast to the new version to see what I missed. It seems to me that that's the same as what these e…
All versions controls have a way to compare, merge and revert historical changes in and out of the current working copy.
Re: Why is it so hard to see code from 5 minutes ago?
#130Earlier quoted context omitted.
Likewise. This whole thread is totally bizarre. The closest imaginable thing I might do is wrapping some block of code in an if(false) {..} or #ifdef it out, when I'm refactoring and feeling unsure about my changes. But is that even the same thing that we're talking about here?
Hello from the bizarro universe of people who do this all the time and can't imagine the opposite. Do you never rewrite some code only to realize it didn't precisely capture all the edge cases of the thing you rewrote? In those cases I use the git gutter in VSCode to view what the old code looked like and compare and contrast to the new version to see what I missed. It seems to me that that's the same as what these e…