From d1852646b2a01ff4e38523c6f5f50dd4ed648b17 Mon Sep 17 00:00:00 2001 From: cjfryer <106983702+cjfryer@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:42:24 +0100 Subject: [PATCH] Make commit messages "imperative" It's ambiguous to say that commit messages should be in the present tense. Both of the following conform to that rule, but the former is preferred: - "Leverage best-of-breed synergies going forward" - "Leverages best-of-breed synergies going forward" We want the "imperative mood" here. I've added an aide memoire about prepending a silent "please". --- source/standards/source-code/working-with-git.html.md.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/standards/source-code/working-with-git.html.md.erb b/source/standards/source-code/working-with-git.html.md.erb index 3e8938dc..3521559a 100644 --- a/source/standards/source-code/working-with-git.html.md.erb +++ b/source/standards/source-code/working-with-git.html.md.erb @@ -107,11 +107,17 @@ ticket is publicly viewable (and likely to remain so). Commit messages should start with a one-line summary no longer than 50 characters. Various Git tools (including GitHub) use this as the commit summary, so you should format it like an email subject, with a leading capital -and no full stop. The Git convention is to write these in the present tense. +and no full stop. The Git convention is to write these in the imperative mood, +as if you are issuing a command to the repository. + For example: > Leverage best-of-breed synergies going forward +It can help to imagine a silent "please" at the beginning of your message: + +> [Please] Leverage best-of-breed synergies going forward + You should leave a blank line before the rest of the commit message, which you should wrap at around 72 characters: this makes it easier to view commit messages in a terminal.