Live data from Hacker News

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

news.ycombinator.com

81–90 of 287 posts

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

#81
Very rarely past a few weeks.

But on the rare occasions I need it, I often really need it. Especially because code that has survived sufficiently unchanged for that long ofte has done so for important reasons.

The amortized value per commit for really old code is likely low, but you get them 'for free' because you want to do them to have them for recent code, and the overall value of having them for older code to the codebase as a whole can be significant.

I'd say the SVN history challenge is an excuse - firstly there are tools that can do it.

Alternatively you can easily enough keep the SVN repo around for those rare occasions people really need to dig.

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

#82
post #77

At least once a month, when modifying some critical piece of code - git blame is the easiest way to find reasons for non-obvious lines of code. BTW: if you sometimes move code around between two git repos (from multirepo to monorepo for example), I wrote a script to move a subfolder between the two and keep history: https://github.com/jakub-g/git-move-folder-between-repos-kee...

Oh that's a cool tool. I'll try to remember it next time.

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

#83
The last time I moved a large codebase from git to svn the surprising thing for me was that a git clone was _smaller_ even though it had all of the history, than svn was holding only truncated history. Everything runs faster, and the tooling is better. They will feel like they traded their gocart for a Ferrari.

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

#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 it back if I want to" is a good feeling.

I think this leads to less cluttered code overall.

Also something that came to mind: When the shellshock vuln was discovered in bash noone really knew when and how it got introduced, because it was so old (literally decades) and there was no version control in that time. I don't think anyone suspects any malpractice with shellshock, but think about it: If you find a really strange bug that looks like a backdoor, and it's 10 or 20 years old. Wouldn't you want to know who committed that code?

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

#86

> they haven't transitioned from SVN to git solely because of the logistical challenge of migrating 30 years of commits lol, I don't think that's the reason. At the only place I worked that used SVN the real reason was that the old guys didn't want to learn something new.

Maybe the old guys didn't think there was a good reason to switch from SVN to git, if SVN had been working for them. It sounds like switching just because git became more popular.

Of course if you're young, it's no big deal since you haven't been using SVN for decades, and what's the big deal with learning something new? But when you've been around the block a few times, sometimes there's needs to be a better reason than the new and shiny.

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

#87
post #19

Frequently. 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…

What's the advantage of doing this over just making an experiment branch? A branch would be easier to find than a reverted commit somewhere in the mainline branch.

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

#88

> they haven't transitioned from SVN to git solely because of the logistical challenge of migrating 30 years of commits lol, I don't think that's the reason. At the only place I worked that used SVN the real reason was that the old guys didn't want to learn something new.

SVN? What's that? All you young whippersnappers keep harping on the new and shiny.

Real men use cvs.

(I kid.)

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

#89
Depends on your project/business.

On my current job, I very rarely go back to see when something was changed, because the business requirements are very straight forward. A change needs to happen, and the implications are clear. Also, no one really documents discussions systematically, commit messages are rather short etc. Not much value can be extracted.

On my last job, a system with over 15 years of history, my team was often puzzled with the existing codebase and the seemingly weird things it did. "Who wants this?", "Is there a usecase for this?" and "Do any of our customers actually expect this functionality if we remove this?" was a frequent question.

Then we'd check the commit history and get the 3-4 tickets involved in the functionality's history. Long discussions and back and forth with the client, explanations why the functionality was being added etc.

This archaeology was so frequently fruitful that all the team engaged in it.

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

#90
Yes, while maintaining code which other people wrote who are no longer around I often have to figure out what they might have tried to do. Being able to see how code looked before someone rewrote it can often give you an idea what it's about. Even better if the people even used good commit messages which explain why they fixed something and why they did it the way they did it.

Sometimes code only makes sense if you can see it's evolution.

Also knowing who wrote it you can ask those people sometimes about it.

Post reply on HN