Live data from Hacker News

Conventional Commits encourages focus on the wrong things

sumnerevans.com

271–280 of 294 posts

Re: Conventional Commits encourages focus on the wrong things

#271

There's no benefit to any of this. Just write like human. It will be clear if it's a fix, or a refactor, or ?. Typically it isn't just one of those things.

Making an opinionated absolute statement about something that's widely used and argued about isn't even logical. If nobody got any benefit, it wouldn't be a thing. The CC standard may not be for everyone, but having some convention is often helpful. git log --pretty=oneline of structured format gives you broad filtering that's useful. Just writing like a human doesn't give you that ability and you're forced to read e…

Can you give an example of something useful you get from commits following the CC convention?

Re: Conventional Commits encourages focus on the wrong things

#272

Earlier quoted context omitted.

Personal preference I guess, but to me all of those commit messages are way too wordy. I'd probably have: [PRJ-123] Refactor Foo out from Bar [PRJ-123] Include Foo data in BazClient [PRJ-456] Null-guard on Foo ID to avoid data loss Bug introduced in commit deadbeef And then in PRJ-456, I'd also have the comment about bug introduced in commit deadbeef, and link the two JIRAs if it was significant, or just mention it i…

Git is more robust than Jira. Git log is accessible offline. Jira descriptions exist only as long as people managing the Jira instance are competent and are migrating the necessary data correctly when migrations are needed. Even migrations from one Jira instance to another (e.g. when companies get acquired and two Jira servers get merged) can be extremely brittle. It's fair that maybe such simple trivial changes don'…

> Git is more robust than Jira.

Much of such issue tracking systems may be better in the repo in the first place. A Jira issue could just be a markdown file committed in the repo. A code review could just be commits of inline remarks/comments.

Maybe there is some value to slapping on a web interface on top of that data for ease of use, but as to where the data lives I'm leaning towards putting everything in repo.

Re: Conventional Commits encourages focus on the wrong things

#273

Earlier quoted context omitted.

Respectfully, I disagree. A good commit message to me is something like: [PRJ-123] Changed blah to foo Blah didn't handle the wangle flange properly in some cases, foo is a better fit for customer requirements. The "why" that justifies the change, is already contained in the JIRA ticket PRJ-123 and explains exactly what the customer requirement was that necessitated the change. It will almost certainly contain a lot…

Interesting to see somebody argue out in the wild for what I have been subjected to in the past and have long considered absolute worst practice. It may be that my perspective is different because my work tends to be in "hard" foundational software (think OS components and programming language tool chains). It's not that customer requirements aren't a thing at all in that kind of work, but they tend to be far removed…

As I said at the beginning of my first post higher up, different companies have different requirements, and there's no one right solution.

But as for the last point, many companies prefer constant integration of work in progress (perhaps with new functionally disabled) for development work that can take multiple weeks, rather than working entirely in a feature branch and introducing a massive change in one go, especially if it's required refactoring work to existing code. On such codebases, my commit frequency would typically be at least a couple of times per week, perhaps a couple a day in some cases.

So, while each commit will have a commit message explaining the change, none of those commits would be a sensible place to try to explain the justification for the work, something which I was already arguing shouldn't be in commit messages at all. The last point was an attempt to show that it makes even less sense to try to replicate the why of the feature requirement in the commit message at all. That is already documented in the ticketing system, the commit message should contain a summary of what changed, to aid a later developer trying to track down a bug.

From your third paragraph, it seems that we largely agree, you just disagree that the information about the ticket a change relates to is important enough for the subject line. If it was a URL link, I'd agree because they are long and messy, but honestly a JIRA reference like [PRJ-123] doesn't use much space and putting it on the subject line seems the best compromise to me, because I consider it mandatory. But if your company prefers a different policy, that's fine too - different companies don't all have to do the same thing.

FWIW, I've also worked in what you call '"hard" foundational software'. In fact, that's exactly where I was first exposed to this policy, recognised it was better than previous systems in previous companies for traceability, and later advocated it in other companies with smaller teams, and also use it myself on my one-man projects.

Re: Conventional Commits encourages focus on the wrong things

#274

Earlier quoted context omitted.

It’s the linting argument all over again. I don’t give a shit what the style is. I give a shit that it’s consistent. Form whatever opinion you want about how you want to format your code, structure commit messages etc. I don’t really care, if you want to start every commit with “poop(fix): pooper my commit message”, as long as you’re consistent about it and enforce it programmatically you have my emphatic support Thi…

That is only true of semantically equivalent things. Tabs vs spaces don't matter they are equivalent. But consistency is only better when it is an improvement. It is fundamentally important that convential commit is better for adopting it to be an improvement. After all in your example wasting the first four characters of your commits with poop would objectively reduce the quality of your commit history, whether or n…

> It is fundamentally important that convential commit is better for adopting it to be an improvement.

Absolutely! Which means we can also agree that conventional commit is objectively better than No System For Their Commits At All, which is what 99.9% of people are actually choosing between when evaluating conventional commit. They aren’t looking at conventional commit vs Some Better Way, they are looking at “we have no standardization of commit messages” vs “we have standardization of commit messages”.

For the 0.1% people for whom that’s not good enough, one hundred percent agree that these people should be pursuing better solutions.

Re: Conventional Commits encourages focus on the wrong things

#275

Earlier quoted context omitted.

Or they could be used as a stepping stone in teaching people the value of being able to summarize what they've done?

How does typing “fix:” or “feat:” get you a step closer to being thoughtful?

To be honest I'm not really sure. I'm also not really sure how tipping "fix:" or "feat:" means people are not understanding their work and performing perfunctory actions though.

Re: Conventional Commits encourages focus on the wrong things

#276

As programmers I feel like we'll always nitpick and bitch over what the optimal setup is for rather mundane things (tabs v spaces, yada yada). I'm not saying that conventional commits are God's given best way to structure a commit message, but they are a defined structure , and I find it much more effective and important that some expectations be set around commit messages, and I think conventional commits are as goo…

Defined structure does not constitute quality. A commit message can be loosely structured, but be very insightful and good at communicating the nature of the change. On the flip side, one can make a very structured but confusing or non-informative commit message. I generally tend to agree with the author, conventional commits do not solve the core issue of the poor commit messages problem.

But it does enforce a minimum quality

Re: Conventional Commits encourages focus on the wrong things

#277

Earlier quoted context omitted.

The switch was too recent in my case, I'm still seeing many numbers from the old system that I can't look up.

You should shout at your project managers then. The data in the ticket system should be considered important as it's the primary interface through which developers, QA and design share information.

They have the data but the numbers restarted at 1 and search in the new system isn't good. I think they all agree the old system was better - but the new license terms were unacceptable so we left anyway.

Re: Conventional Commits encourages focus on the wrong things

#278

Earlier quoted context omitted.

I don't need a standard for this. This is just noise. There are some people who have some sort of mental ailment that makes them obsessively want to introduce "structure" "scheme" "patterns" where it is just innately nonsense. You do you, but stop trying to force it on people. Reminds me of the "scrum master" adjacent folks who could never cut it writing code and then branched into all kinds of things like "Git Flow"…

Reminds me of a place I worked at where a "naming committee" had to approve variable names. And no, you could not use "i" as an index in a one-line loop.

Being able to specify word boundaries in search is a basic feature for any developer tool. Vim has *, #, and /\. grep also has \ and the -w option. LSPs have jump to definition and find references features.

Re: Conventional Commits encourages focus on the wrong things

#279

Earlier quoted context omitted.

You should shout at your project managers then. The data in the ticket system should be considered important as it's the primary interface through which developers, QA and design share information.

They have the data but the numbers restarted at 1 and search in the new system isn't good. I think they all agree the old system was better - but the new license terms were unacceptable so we left anyway.

Restarting at 1 makes sense only if you think you’re going to run out of integers.

I can’t fathom why part of the deployment of the new system wasn’t to re-seed to the current ticket number or an easy-to-remember integer (hopefully via database, but also ok even if via a Selenium for loop to pull 19,999 tickets to burn the numbers in the new system).

Re: Conventional Commits encourages focus on the wrong things

#280

The real takeaway is that different projects have different requirements. In over 30 years of using source control, I've never once worked on something where it's useful to include the component (article calls it scope) in the description in a standardised way. It's obvious what components are affected based on where in the source tree the affected files are. Similarly "bug", "fix" or "feature" adds no useful value.…

This is the way we did it when we used JIRA. For GH issues you can always navigate back to the PR discussion (which should have linked issues and other pointers in it) from the commit. Of course when we switched to GH issues, we largely abandoned JIRA and years later the instance got turned off and deleted. Now all those JIRA tags are entirely useless. IMO that actually argues for tight coupling between your issue tr…

> Of course when we switched to GH issues, we largely abandoned JIRA and years later the instance got turned off and deleted. Now all those JIRA tags are entirely useless.

I agree that this is a problem but at the same time associating commits with a ticket number is useful, especially if I have dozens of commits on a single ticket and am doing trunk-based development (so not all commits are on the same short-lived branch). Maybe the lesson here is that, once completed, tickets should be exported and stored in the Git repository.

Post reply on HN