Post

Am I the only person that thinks putting Jira ticket references in commit messages is straight up a bad practice. We have other ways of linking changes to tickets (PRs for example), commit messages should describe the change in the commit as best as possible.

0 reposts1 like

I hate this! Absolutely not a substitute for a well written commit message that details the change and reason. It's completely useless to anyone that doesn't have access to that ticketing system, or doesn't even know what #12345 means...

It also enforces the idea that 1 Jira ticket equals 1 PR which also seems bad practice - rather than many small low risk PR's we end up with 1 big one that satisfies the user story

I think the practice of commits being holistic changes is the issue. People seem to think that a single commit should be an entire ticket's worth of changes. Your commit message should tell you what changed, if you're linking to a Change request number, that's probably a bad smell of coupling

I assume that is because the Jira integration with your Git repo is dependent on having the ticket number in the branch, PR and/or commit messages. Probably depends how much they care about Jira being able to track that info against each ticket

I work in a place that currently enforces this on every commit, and when I try to discuss removing this constraint people start referring to it as a "good practice", I feel like I'm going crazy!

I don’t know if it is good practice but I bet there is a really interesting story behind why your org does that. I would probably get annoyed by it really quickly.

One advantage of referencing GitHub issues with commits is that if working from command line it auto references when you do a gh pr and are retained even if you don't do merge commits or do squash commits.