Skip to content

Commit e4656cd

Browse files
committed
📝 docs: update about section
1 parent b407727 commit e4656cd

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

README.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,37 @@ A Commitlint plugin to ensure that commits are made using imperative mood.
4444

4545
<div align="center">
4646

47-
If you want to write a git commit message properly, you should use the imperative mood. This means you need to eliminate the temptation to use gerunds or past tense in your subject lines. Don't write a git commit subject line that talks about what you did, or what you are doing. Instead, describe what was done.
47+
If you want to write a git commit message properly, you should use the _imperative mood_. This means you need to eliminate the temptation to use gerunds or past tense in your subject lines.
48+
49+
Use the _imperative mood_. It is easier to read and scan quickly:
50+
51+
We use _imperative mood_ because it's going to complete the sentence “**If applied, this commit will …**
52+
(e.g. “**If applied, this commit will** _add alert admin for new user registration_”).
53+
54+
Using _imperative mood_ and not past tense in commit messages has made a big thread of discussions between developers over the question _“Why should it be present tense?”_.
55+
56+
The reason behind using present tense is that the commit message is answering the question _“What will happen after the commit is applied?”_. If we think of a commit as an independent patch, it doesn’t matter if it applied in the past. What matters is that this patch is always supposed to make that particular change when it’s applied.
57+
58+
Even Git itself suggests and uses imperative mood in commit messages in [Documentation/SubmittingPatches](https://git.kernel.org/pub/scm/git/git.git/tree/Documentation/SubmittingPatches?h=v2.36.1#n181)
59+
60+
For example, the default message created when using `git merge` reads:
61+
62+
```
63+
Merge branch 'feature/login'
64+
```
65+
66+
And when using `git revert`:
67+
68+
```
69+
Revert "Add the thing with the stuff"
70+
This reverts commit cc87791524aedd593cff5a74532befe7ab69ce9d.
71+
```
72+
73+
Or when clicking the “Merge” button on a GitHub pull request:
74+
75+
```
76+
Merge pull request #123 from someuser/somebranch
77+
```
4878

4979
Use this plugin to enforce this rule.
5080

0 commit comments

Comments
 (0)