Let's pick each other's brains for a sec.
Do you use past or imperative tense in your commit messages?
Past
added button to page
Imperative
add button to page
Discuss
Why? Pros vs. cons? Have you tried one and moved to the other? Which one makes better sense?
Oldest comments (31)
I'm using past tense (at least mostly) because the commit reflects something I did in the past. Seems natural to me this way...
I was using past tense till I realized present simple is being used in GitHub, GitLab, and GitKraken commits (Add/Update README, Merge: foo, Revert: bar).
I usually use the present tense. It sounds more natural when thinking in terms of "what does this specific commit do". I think of a commit is a snapshot of an event, rather than a fixed point in history or a changelog.
+1000 to this. It also lends itself to easier reading/scrolling through
git log
. 👌Imperative, because in theory, I could revert that commit that adds something later. Version control is a constant present state that can change freely. I'm unlikely to ever actually need change management on a personal project, but I do want to keep with the spirit of it all.
Though, admittedly, if I'm doing a bunch of stuff all at once that would be a mess to change later, I tend to past tense it like "Added this, updated README, bumped dependencies, changed this" because 1 commit with all that mess isn't ever getting reverted.
The imperative is a mood not a tense! :) I use present tense and follow the Conventional Commits specification on most projects ("fix: disable current deployment type in index filters").
Imperative for simplicity and for non-english readers.
Using imperatives is the official way of writing commit messages, as if each message were prefixed by "This commit will...". I personally prefer this as it's very straightforward and shortens some messages by a few characters.
From git-scm.com/book/en/v2/Distributed...
Imperative and the first letter capitalised. But sometimes I just write whatever I feel and put smiley faces or crying ones (not at work =P)
It depends on the level of my caffeine gauge
Present continuous tense feels more natural to me.
E.g. "fixing blah blah..." Vs "fixed blah blah..." Or "fix blah blah...".
Reason is that it shows the original intent because really it's not "fixed" or is a "fix" until it has been reviewed, gone through automation and qa testing and finally merged.
I like to use Imperative for consistency with Jira tickets.
I usually follow the guidelines proposed here which I think they make valid points. See section 5: use the imperative mood in the subject line.
I also adhere to the Conventional Commits spec.
I love these guidelines chris.beams.io/posts/git-commit/
”A properly formed Git commit subject line should always be able to complete the following sentence:
If applied, this commit will your subject line here
For example:
If applied, this commit will refactor subsystem X for readability”
Meaning imperative instead of present or past tense
I usually do it in past tense because I kind of view it as a log of all the things I've gotten done. The same way if someone asked what you did today, you'd say "I went to the store, I gazed at some clouds, I worked out (lol)," if someone asks what I've gotten done on a project, I'd say I "added button to page."
I finish this sentence "If you pull this it ..."
i.e.
adds new feature to menu
updates readme
fixes broken sql
This is good.