News for hackers. Stuff that matters.
Re:Write good git commit messages by tqkxzugoaupvwqr on Wednesday December 12, 2018 @07:26AM (#18663301)
Question: I use past tense instead of present tense because I explain what changed. But I see a lot of commits written in present tense. Is one better than the other? Which one?
Re:Write good git commit messages by laumars on Wednesday December 12, 2018 @07:44AM (#18663394)
You'll get plenty of devs who's make an impassioned argument that present tense reads better (and they'd be right to an extent) but honestly it's really more of an OCD thing than anything. The important thing is that messages are detailed enough to be accurate but terse enough to be eyeballed quickly (if you need more detail then include that after the first line summary); and that you include reference numbers if you're commit is in relation to a ticket (eg JIRA, Github Issues, etc).

Some people add tags, emoticons and other stuff. But the real key is consistency. Pick a format and stick with it

Re:Write good git commit messages by brlewis on Wednesday December 12, 2018 @08:41AM (#18663751)
If the key is consistency, use present tense. If you consistently use past tense, that works until your team merges with another one that's more conventional.

The commit message is the headline of your story. Headlines are in present tense even though they describe past events.

Re:Write good git commit messages by laumars on Wednesday December 12, 2018 @09:04AM (#18663948)
Honestly, out of all the things people argue about this has always struck me the strangest. It's the part that makes the least real world difference (vs not including ticket numbers - for example) yet it seems to be the thing people get the most impassioned about.

Consistency is important, but if you're expending more energy arguing about it than you would deciphering past tense message then you have serious questions to ask yourself. :P

Re:Write good git commit messages by jstimpfle on Wednesday December 12, 2018 @08:51AM (#18663844)
If you want consistency, do the simplest thing possible. Past tense is more complicated then present tense, and does not add value.
Re:Write good git commit messages by Double_a_92 on Wednesday December 12, 2018 @07:34AM (#18663347)
Past tense doesn't describe what the commit does, it describes what the developer did.
Re:Write good git commit messages by rocqua on Wednesday December 12, 2018 @07:56AM (#18663468)
This.

The point of an imperative present tense voice is to consider the message from the point of the commit, not from the point of the committer.

Commit messages aren't meant to show you did work, they aren't meant to show what work you did either. They are meant to show what changed.

Re:Write good git commit messages by syn0byte on Wednesday December 12, 2018 @09:59AM (#18664420)
You mean "what changes." Consistency dammit!
Re:Write good git commit messages by FelipeCortez on Wednesday December 12, 2018 @07:31AM (#18663329)
Git itself uses the present tense (Merge/Revert)
Re:Write good git commit messages by michaelmior on Wednesday December 12, 2018 @08:56AM (#18663893)
This for me is the main reason I prefer to use present tense since it maintains consistency.
Re:Write good git commit messages by aequitas on Wednesday December 12, 2018 @07:37AM (#18663357)
I tend to use present tense as I'm describing the change that is to be applied to the code by the commit. It often also is terser than past tense by a few chars, sometimes just enough to fit in the commit title (Add vs Added).
Re:Write good git commit messages by lomnakkus on Wednesday December 12, 2018 @07:35AM (#18663351)
Present tense -- it's (almost?) always a little shorter, so you can fit more information into the "subject" line.
Re:Write good git commit messages by pritambaral on Wednesday December 12, 2018 @07:40AM (#18663377)
"If applied, this commit will ______".

Simple present[0] tense.

0: https://learnenglish.britishcouncil.org/en/english-grammar/p...

Re:Write good git commit messages by yongjik on Wednesday December 12, 2018 @07:41PM (#18668959)
Can now open multiple files simultaneously.

...OK, now what?

Re:Write good git commit messages by mikelward on Thursday December 13, 2018 @01:10AM (#18670225)
Allow opening multiple files simultaneously

Handle multiple open files

Support multiple open files

Or similar

Re:Write good git commit messages by karmakaze on Wednesday December 12, 2018 @07:55AM (#18663464)
Using the present tense makes sense as that's the context of the change and it makes it easy to reference what it used to do or what it's set up to do into the future by using other tenses.
Re:Write good git commit messages by rimliu on Wednesday December 12, 2018 @07:38AM (#18663363)
The sometimes suggested guideline is: make commit message so that it would make sense if added to the phrase "If applied this commit will…".
Re:Write good git commit messages by detailyang on Wednesday December 12, 2018 @07:29AM (#18663320)
ditto