From fee33b3758e598363c011227f8f54f52781642d8 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 13 Mar 2025 22:27:47 +0000 Subject: [PATCH] Add daily email for 2025-03-01 Solve one problem at a time --- source/_daily_emails/2025-03-01.md | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 source/_daily_emails/2025-03-01.md diff --git a/source/_daily_emails/2025-03-01.md b/source/_daily_emails/2025-03-01.md new file mode 100644 index 000000000..1f1ad01c7 --- /dev/null +++ b/source/_daily_emails/2025-03-01.md @@ -0,0 +1,38 @@ +--- +title: Solve one problem at a time +date: 2025-03-01 +permalink: daily/2025/03/01/one-problem +tags: + - software-development + - git +cta: ~ +snippet: | + When you're committing a change, it should only solve a single problem. +--- + +When using `git log` to look through the history of codebases, I often see large commits that combine several changes. + +These also lead to vague commit messages like "Changes", "wip" or "Fixes". + +These aren't helpful when reviewing the history and large commits are difficult to review and revert if there is a problem. + +Each commit should be focused on a single change, whether its adding part of a new feature, fixing a bug or refactoring. + +If it's a combination, they should be split into separate commits. + +Each commit should have its own well-written commit message that explains why the change was needed, any consequences or manual deployment steps, alternative approaches that were tried, issues encountered and any follow up actions. + +If you can't properly describe the changes made in a commit, the commit is too big. + +You should uncommit the changes and use `git add -p` to create a more focused commit. + +This is why [I don't squash commits][0]. + +If people have made an effort to create good commits with good commit messages, I don't want them to be lost when the commits are merged. + +I want to keep the history of the changes intact and as it originally was. + +I do sometimes need to [tidy up my own commits][1], though, before I push them for anyone else to see. + +[0]: {{site.url}}/daily/2024/05/11/don-t-delete-my-commit-messages +[1]: {{site.url}}/daily/2025/02/11/tidy