by vsviridov · 4y ago · 0 comments
Just no...
Why would you decouple the change from its context? Just add all the relevant information to the commit message itself, so it's preserved.
I follow my friend's approach which works really well.
https://yrashk.medium.com/solving-problems-one-commit-at-a-t...
Too many a times I had to do code archeology to encounter archived Jira or some old space I don't have permissions for, that was originally migrated from GitHub issues and all the ticket numbers are in complete mismatch.
You also can't update a commit message after you've pushed it.
Agreed though that you shouldn't work like this if you can't trust your organization to reliably archive your issue threads!
Now I'm wondering how big a git commit message can be and if a base64-encoded image would fit...
> You also can't update a commit message after you've pushed it.
Check out "git notes", it lets you add more to a commit message without changing the hash. No idea how it interacts with things like gitlab/hub.
The issue is the context.
At work, we require a link to the issue/story because it makes SOC2 audits much easier. The commit message is a great place to explain the chosen implementation, but that's not all there is to software development.
It rarely makes sense to repeat in commits how the issue was reported, or why it was given a specific priority. And it can't track anything after merge, like how the change was tested, or whether the change was communicated to users.
Maybe you don't have to deal with auditors. Maybe your work has different processes to keep them happy. But as far as I'm concerned, is it important to link the issue for context? Yes! Just yes.