oliverdavies.uk/source/_daily_emails/2024-09-03.md

32 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

---
title: Do your commit messages still make sense?
date: 2024-09-03
permalink: daily/2024/09/03/do-your-commit-messages-still-make-sense
tags:
2024-09-08 22:09:54 +00:00
- software-development
- git
cta: d7eol
snippet: |
2024-09-08 22:09:54 +00:00
Do your commit messages still make sense?
drupal_planet: true
---
Once you've [cleaned up and tided your commits][1], re-ordered them and squashed any commits together to combine them into logical changes, before you push them, you should also check if your commit messages still make sense.
Using short or generic commit messages is fine when spiking a solution in very short feedback loops, but when you push your changes, you want them to be as descriptive and meaningful as possible.
If someone ran `git log` weeks, months or years from now, would they get value from reading the commit messages?
Are you using the subject and body correctly and wrapping text when needed?
Does each message accurately reflect and describe the change?
Does it capture why the change is needed, any alternative approaches that we considered or tried, or any complications that were encountered?
If you're following a standard like [conventional commits][0], have you correctly included the required information, such as the type, scope and any references, such as the task reference?
Having a Git log with detailed history is valuable when you need to review the changes in the future, but it also makes it more likely your changes will be approved and merged, whether you're working on a paid project or volunteering on an open-source project.
[0]: {{site.url}}/daily/2022/09/01/conventional-commits-changelogs
[1]: {{site.url}}/daily/2024/09/02/no-one-sees-your-clean-up-commits