17

This question already has an answer here:

I often read/overhear that good commit messages should be written in present tense or to use imperative mood when describing the change eg. Fix xyz instead of Fixed xyz.

What are the advantages of doing so? Are there differences between the various VCS (I mostly read these about git but that maybe because I mainly work with git)?

marked as duplicate by Bart van Ingen Schenau, user40980, gnat, jwenting, Wayne Molina Jun 20 '14 at 21:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4

Another angle to consider is your commit's scope and your perspective (primarily for distributed VCS)... You can create all the local history you want, but it only becomes past tense once it's merged into the primary code branch.

In other words, the project lead needs to review it, and they apply my commit to "fix YYY". The bug itself only becomes "fixed" once someone authorative approves it and merges it in to the project.

For centralized systems, past tense seems more accurate, at least from this perspective.

11

When you use "Fixed XYZ" you can import it straight to your changelog. For example PHP Changelog.

18-Jul-2013

  • Core:
    • Fixed bug #65254 (Exception not catchable when exception thrown in autoload with a namespace).
    • Fixed bug #65088 (Generated configure script is malformed on OpenBSD).
    • Fixed bug #65108 (is_callable() triggers Fatal Error).
    • Fixed bug #65035 (yield / exit segfault).
    • Fixed bug #65161 (Generator + autoload + syntax error = segfault).
    • Fixed bug #65226 (chroot() does not get enabled).
    • hex2bin() raises E_WARNING for invalid hex string.
  • OPcache:
    • Fixed bug #64827 (Segfault in zval_mark_grey (zend_gc.c))...
9

As I understand it, the present tense means that the commit itself fixes the issue, not the developer which could be implied by using the past tense -"the developer fixed the issue".

  • I believe it would be the code being committed that fixes the issue, not the action of the commit. The comment is stating that this unit of code fixes (in part or in whole) XYZ. – Matthew Flynn Jul 20 '12 at 16:51
  • Yes, I agree and for me that's what the "commit" is - the set of things being committed. – Otávio Décio Jul 20 '12 at 16:58
4

As was mentioned a little, for centralized versioning systems, past tense seems more accurate (Ex: Fixed the looping issue). Because, it expressed the committed and completed work.

Otherwise, it would sound like TODO List (Ex: Fix the looping issues), that needs to be done in near future.

Not the answer you're looking for? Browse other questions tagged or ask your own question.