This question is quite specific but I am not sure which verb tense I should use when committing/checking in code.

If I fix a bug and checking in the code, should I write:

  1. Fixes bug on feature A
  2. Fixed bug on feature A

I always use past tense because the bug was fixed before I check in but it looks a bit strange when I look at file history.

Should I use one over the other and why?

  • 2
    Use Biblical tense. And I will strike down upon the exploit with great vengeance and furious anger those who would attempt to SQL inject and pawn my brothers. – dotancohen Jun 18 '14 at 8:00
  • 1
    It is totally down to the way you decide to do things in your team. Some people prefer to use the present tense for the things that are in the check-in, and the past tense to describe how things were beforehand (ie describing the bug). – Rupe Jun 18 '14 at 10:23

Both are appropriate, it actually depends on the way you want the user to read it.

1. Fixes bug on feature A - This is more universal, this will let people know that the check in has feature A bug fixed. So, this is the tone of the check-in and not that of the user.

2. Fixed bug on feature A - This has more to do with the tone of the user who is checking in.

So, in case you are working on an open source project with lots of people reading about the check-in, and they like to know about the check-in more than the user who did it, try to go with option 1, else, go with option 2

| improve this answer | |

The following convention for commit messages works well for me:

  • Describing what changes were made to the code in the commit: Past tense.
  • Describing what the code was doing before the change: Past continuous.
  • Describing what the code does, especially after the change: Present tense.

Encoding the distinction between the three kinds of actions using the tense of the verb keeps the messages compact.


Fixed bug 178508 (Wrong permissions on keydir)

Exclude the base directory from rsync -a, so that the permissions of the destination directory remain unchanged. Previously, rsync -a was clobbering / would clobber the destination directory's permissions.

| improve this answer | |

I don't understand what you felt strange about it. That sounds appropriate to me.

"Fixed bug on feature A" should be correct as you already said bug has already been fixed at the time when your where committing your code.

| improve this answer | |

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