Hacker News new | ask | show | jobs
by afterburner5 1426 days ago
I can see where the author's coming from. However, my approach for a PR might be a bit of a mix. Normally, I aim to make a PR be reviewable, commit by commit. However, in some cases, due to a semicolon missing (you get the point), or some instance where I'm being daft, or me bumbling in the dark trying to fix a piece of ancient, undocumented code, the history might end up being less than clean. The messages will always describe my train of thought in those scenarios, but the overall history wouldn't be cut and dry.

I tend not to worry about that and generally just squash the commits when I merge, so that, on main, there's a single commit for a particular feature. That's an overall piece of work I did. If someone wants to dig into a feature commit by commit, they can typically check the PR out and do it that way, but in practice, I've rarely seen that happen, and if it did, it was more for the overall feature rather than any one commit.

So, overall, it's not that commit messages don't matter, but rather that, while a pristine history is always nice to see, it's not always possible without unnecessary head scratching that generally just costs more dev time for very little benefit.

2 comments

You know that you can edit the history in order to fold the small fixes and mistakes back into the commit they belong to right? It’s not an all or nothing situation.

> If someone wants to dig into a feature commit by commit, they can typically check the PR out and do it that way, but in practice, I've rarely seen that happen

Of course not, it’s a pain in the ass having to go back to the PR and trawl through a commits sequence you describe as essentially broken.

I know that, but what advantage do you get from trawling through a commit sequence, over the general feature with proper documentation? If you can't understand how the overall feature was implemented, that PR generally speaking is lacking enough context to be reviewed, so why did it get merged in?
Does anyone actually review PRs commit by commit?
When the history is designed for that, sure. Although having the review tool also designed for it makes this much more convenient and comfortable.

Github, sadly, very much is not designed for that.