logoalt Hacker News

ralferootoday at 4:29 PM8 repliesview on HN

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. It's important or it wouldn't be checked in.

The only thing I've found useful, and which the article doesn't even consider, is a link / id for the relevant change request. The commit already contains all the information about what was done in the change, what's missing is the context about why.

Even on my solo projects I include a JIRA reference in square brackets before the description. If it's just something I randomly decided to fix during the course of development, I'll create a short 1 line JIRA to get an id and explain the why there.


Replies

eikenberrytoday at 6:53 PM

> The only thing I've found useful, and which the article doesn't even consider, is a link / id for the relevant change request. The commit already contains all the information about what was done in the change, what's missing is the context about why.

The "why" is THE thing that needs to go in the git commit message. Capturing "why" is the entire point of that message and slapping a link to some external (and eventually absent) resource is not a good substitute.

show 1 reply
dualvariabletoday at 6:14 PM

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 tracker and your git repo. And what you really want is portability (which I don't see how you get other than with tight coupling). Ideally there would be open standardized formats, but as it is, github is the 800# gorilla that defines the format and as long as gitlab and other clones can slurp in github project metadata (or at least PRs) then that effectively gets you closer.

But any way... Fixed, immutable pointers to an Atlassian product that you might not be using in 5 years is not a good policy. I'd sooner accept the policy that the git commits needed to stand entirely on their own and all the information about the "why" of the change needed to be baked into the git commit or the comments in the source (I think that fails, though, since everyone is overly terse in git commits and summarizes issues and loses information--and the back-and-forth dialog in a PR discussion is useful because it contains more than just one person's voice summarizing the reason for the change).

show 1 reply
SamuelAdamstoday at 5:41 PM

It is useful if you automate generating release notes. Then your notes are grouped by new features first, then bug fixes after. This makes it a little easier for non-technical uses to read.

show 1 reply
oskarpearsontoday at 7:05 PM

The handling of ticket numbers is covered in the FAQ (scroll to the bottom)

[edit] At the bottom of https://scopedcommits.com/ I mean

literallyroytoday at 5:22 PM

Is the benefit of using a separate source that you can include images or something else I’m missing? Couldn’t you include context in the commit body?

chickensongtoday at 6:46 PM

> Similarly "bug", "fix" or "feature" adds no useful value.

If you're not using/tied to an issue tracker, embedding tags like these in git gives you some basic metrics.

calvinmorrisontoday at 7:23 PM

fixes/feature labels help when generated semver and doing changelogs if you publish them externally or internally.

JIRA tickets can help to, its about giving context to why the commit exists.

I find the 'component' label most helpful in large monorepos.

adammarplestoday at 5:46 PM

Pretty much everywhere I've worked recently enforces some kind of jira ticket number in the PR title