All the time! Two weeks ago I found something in a critical library at work (that ~every single C++ binary we run depends on: our main implementation of our custom threads' executor API) that made no sense. I couldn't understand why a variable was being rounded before being passed down to a lower layer, in a way that introduced an average 0.5 Ms of latency to many operations (I estimate that at peak, just one of the…
Ask HN: Do you ever truly use your revision history?
121–130 of 287 posts
Re: Ask HN: Do you ever truly use your revision history?
#122Sometimes there are clues sometimes not, but you can often see the line change in the context of changes to other files and that can help.
For this reason I tend to make quite verbose commits with the context of why I'm making the change. A comment in the code would go out of date, and pollute readability, but a well written commit can be very useful.
Re: Ask HN: Do you ever truly use your revision history?
#123Then for our users it's like you can have one name and one name only if you change it, it's going to be that name forever in the past too
Tables should have revisioning on as a default
Re: Ask HN: Do you ever truly use your revision history?
#124Frequently. Just this evening I was looking in the HN repository for the last version of the code that pg wrote, to remind myself how he used to do something. One of my favorite tricks is to make a file out of all the changes in the history: git log -p > bigass and then grep through the file (edit: which I like to do in Emacs—hence the file) to see every appearance of some construct. There's a lot of knowledge in the…
> Such an approach only works if your system is small,
I see no reason why this wouldn't scale if you (and other people working on the same codebase) just maintain individual branches (say "dang-braindump"). Just do exploratory/documentation work on that and cherry-pick, rebase -i or git merge --ff --squash --no-commit to skip the reverts.
Re: Ask HN: Do you ever truly use your revision history?
#125I do, I think. I often blame individual lines to see if there's information in the commit about the reason for the change. It's often straightforward to understand what's happening when reading code, the information that's often missing is the why. Sometimes there are clues sometimes not, but you can often see the line change in the context of changes to other files and that can help. For this reason I tend to make q…
Re: Ask HN: Do you ever truly use your revision history?
#126We just switched from Perforce to git at work, and about the first 2/3 of a project I work on got squashed together. It took me less than a week to bump in to that "initial commit" when trying to figure out why a bit of code is the way it is. "git blame" (or the p4 equivalent) is my usual archaeologic tool in this context, but "git bisect" has been very helpful in others. For the first, it should be easy to look at y…
1. Why did you switch? Are you satisfied with the new experience?
2. Why was some of the history needed to be squashed? Were there any technical concerns?
Re: Ask HN: Do you ever truly use your revision history?
#127I build custom automation equipment, which involves individual 100-400 hour projects. They're developed in a continuous scratch-to-complete flurry, with a few days of revision after customer review and installation, a year's warranty that typically involves 1-5 on-site days, and an annual "we never read the manual please remind us how to calibrate it again" for the next decade. Very little maintenance coding, lots of fresh feature development.
I disagree that there's diminishing value to older commits. You're more likely to forget what you did the farther back you go!
I'd estimate that I use revision history maybe 0-2 times in a typical project. But that's an easy way to recover a couple days of work that would otherwise need to be rewritten from memory, or worse, reengineered from scratch! You can write a lot of commit messages in 16 hours, so one incident where you can recover two days of work makes two months of using version control without ever referencing the history worth it. Plus, it's a nice security blanket for me, I don't worry about commenting around old code or making changes to a reference implementation I'm modifying because I know it will be in version control.
I do think it's exceedingly unlikely that you'll suddenly decide to revert to the state of your codebase from 20 years ago. If you transitioned to Git and kept the SVN repository around for the rare occasion when you need to reference it, at least in my projects, you'd be able to do so without much trouble.
Re: Ask HN: Do you ever truly use your revision history?
#128Re: Ask HN: Do you ever truly use your revision history?
#129IMHO revision history is just as valuable to a company as the code itself.
Re: Ask HN: Do you ever truly use your revision history?
#130Sometimes those changes are over a decade old (of course such old changes make it more unlikely that they are still buggy, but new changes may interact with those old changes in unexpected ways).
So yes, the older a code base, the more important a complete change history becomes.