Live data from Hacker News

Ask HN: Do you ever truly use your revision history?

news.ycombinator.com

101–110 of 287 posts

Re: Ask HN: Do you ever truly use your revision history?

#101
Yes, sometimes you see some weird code and you have no idea why it was added, searching the history I can see the commit and the ticket related with that piece of code.

Also sometimes you want to find the author of a piece of code to ask more questions why some things was done a certain way.

Re: Ask HN: Do you ever truly use your revision history?

#102
Yes. Sometimes you need to know why a particular thing was done.

Recently I had to go back and find out why a particular conditional was added to the code. 10 years prior someone added in a particular conditional for a bug in IE8 (which we no longer support). There was a Jira associated with it. I then knew I could remove this odd logic as it was no-longer relevant.

Re: Ask HN: Do you ever truly use your revision history?

#104
The more public and more developers it has, the more I use it. The project where I use it the most is Linux kernel. It's also probably because there's a strong requirement to actually write useful commit descirptions. But if changes come from so many developers, it's very useful to catch up on news, what's coming to the next kernel release, what changed in what driver or subsystem, what might have caused the regression I'm seeing, who to contact, etc.

On personal projects I don't use it that much.

Re: Ask HN: Do you ever truly use your revision history?

#105
post #84

I think there's some indirect psychological value that shouldn't be underestimated. People have a tendency to comment out unused code "in case they still need it". Or not delete unused stuff, because who knows what. I have the feeling that I'm much more inclined to just delete a bunch of code lines that "I might still need in some situation" if I know there's version control. Because even if it's unlikely, "I can get…

One thing CVS (yes, that one) taught me was to create versioned “attic.“ files and throw all aging code in there separated by enough newlines instead of commenting out or just deleting. While you can search through a history, it is much easier to have an inactive source with all the remnants you may need to revive in a week. Once things are done, delete it from there and then you always know where it was or how it looked like.

Re: Ask HN: Do you ever truly use your revision history?

#106
In 2013-2014, I was tracking a strange bug in a legacy accounting software.

I was reading the business logic that triggered the bug and it made no sense.

I activated the blame view of the code, and I realized most of the code had been written in ~1998 but a couple lines had been updated in ~2007, by someone who probably never even met the original author.

Realizing that made it a lot easier to understand the context of the bug and fixing it.

There is a lot of value in knowing that two lines of code next to each other have been written decades apart by people that did not coordinate with each other. Never erase that history voluntarily.

Re: Ask HN: Do you ever truly use your revision history?

#108
At companies I worked it was used for political games within. Use it to blame bad code, use that blame later on performance review, deny bonuses and/or salary increases.

After transitioning to freelancer and being the sole user of it, it finally allows me to use it for its true purpose, namely refreshing my memory on some techniques. Sometime I copy/pasta code from older revisions on a different project because that's the code I need for current project (while the current code of that project changed due to client requirements changes). Also sometime it's used by clients to see how the status of the project evolved over time, so it also serves as a metric purpose.

Re: Ask HN: Do you ever truly use your revision history?

#109
A good UI is key. If your editor can navigate blame and commit history with just a key press, it actually speeds up figuring things out, especially in old codebases with bit rot. Benefiting from 10+ years of history might be rare, but two years feel like yesterday.

Re: Ask HN: Do you ever truly use your revision history?

#110
post #51

We 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…

I spent a couple months experimenting with p4git to make sure we got a real history imported. They didn’t get every repository right and I made them redo a few, did a few others over again myself. But lately I’ve been delving into some of the early architectural changes, trying to figure out why a bunch of things get loaded and seemingly never used/only used once... and sure enough someone did some sort of single com…

> I want to be able to go back and add notes to commits

Interesting idea - how about using tags for this?

Post reply on HN