I find it unnatural to write commit messages in the present tense. To me, it seems like commit messages are a log of what work has been done, which would naturally be described in past tense. Nonetheless, I do write my commit logs in present tense for the sake of consistency.
Does anyone have a good explanation of why commit messages should be in the present tense? (Beyond what the article says: "This convention matches up with commit messages generated by commands like git merge and git revert.") Why do commands like git merge and git revert generate commit messages in the present tense? The best explanation that I can think of is an analogy to literature: literary analysis is written in the present tense, because any time you open a book, the story is happening now, in the present tense. I don't quite buy that, but it's the best explanation I've come up with.
My guess is that it's because it was designed from the point of view of someone looking at patches to be added, rather than from the point of view of someone who writes a bunch of code. Imagine you're looking at a patch and asking what it does. It's more natural to describe that this patch will "add support for feature X" than "added support for feature X".
For example, think about the "fast-forwarding", "rewinding" and "replaying" that Git does. When you rebase, Git rewinds your divergent commits, fast-forwards the branch, and then replays your commits again. What happens when it replays those commits? Fix login bug. Update copyright year. Ignore log directory. Done!
I don't know it seems so weird to see it like that, fix login bug seems more like a todo than an action.
I could understand if it were in this format: Fixes login bug. Updates copyright year. Ignores log directory. Those seem so much more like actions than the other.
I also find writing commit messages in present tense unnatural.
Possible Explanation for present tense commit messages - Commit messages are treated as Instruction(s) to a third person, as if she is applying the patches one-by-one.
"Implement Feature A"
Now, "Fix the bug in the previously developed Feature A" etc.
I hesitate to be this guy, but: If I'm not mistaken, strictly speaking, the mood/mode is imperative, but the tense is present. Imperative is not a tense. In English, there are only two true tenses: past and present.
I used to find it unnatural too. Recently, I changed my working habits so that I keep a running todo list of things I'm working on. When I complete a task, the todo becomes the commit message, and I leave it in present tense.
Other reasons to prefer it:
* It's generally shorter than the alternatives: "Implement" versus "Will implement", "implements", or "implemented".
* I think it's actually more accurate to say that commit messages should be in the imperative mood, not the present tense. The message is basically telling some unspecified agent to do something "Fix this bug." That lines up with the imperative form we use to write a lot of code.
Clearly there is an ordering between commits -- parents and children -- but I don't see commits as having much temporal value.
Branches and commits can be merged and rebased left and right, and it only seems to follow that commits have an intrinsic state that's (not to be cliché) timeless. Patches and commits, regardless of when they're written, provide changes and accomplish X Y and Z -- it's only when one runs the code that time comes into play.
Semantics, I suppose, or I have had too much coffee this morning.
The idea i get is that the log is not a history of your actions, but a description of what that particular revision does. So if i take the diff and apply it to my tree, the log tells me what it will do.
Does anyone have a good explanation of why commit messages should be in the present tense? (Beyond what the article says: "This convention matches up with commit messages generated by commands like git merge and git revert.") Why do commands like git merge and git revert generate commit messages in the present tense? The best explanation that I can think of is an analogy to literature: literary analysis is written in the present tense, because any time you open a book, the story is happening now, in the present tense. I don't quite buy that, but it's the best explanation I've come up with.