4

Some products can parse a special syntax in commit messages to extract additional data, such at time tracking information: https://confluence.atlassian.com/display/FISHEYE/Using+smart+commits

To me, this seems like the misuse of one tool to activate a feature on another, but I'm having trouble articulating my reasoning. It seems similar to the process smell of storing issue tracking information in code comments.

Is there anything fundamentally wrong with using commit messages as a time tracking mechanism?

2 Answers2

6

I've seen this feature as well, and am also wary of it. If I were to articulate my reasoning, I would say that it muddies the cleanness and intent of a commit message. When I ask myself, "what is the intent of a commit message?", it is to act as a succint breadcrumb to myself and others about what I was working on and how I tried to make it better.

To that end, a commit message with an issue number is actually a good thing because both I and another programmer could definitely care about that and use it for reference. Having just an issue number with no description is not particularly helpful without the issue tracking tool, so I try to avoid that and still keep at least a short description. Having an issue number even without access to the bug tracker could still help my eye easily pick out related commits.

But time tracking? Six months from now, that will not benefit me or another programmer. Additionally, it will make the commit log look messy.

J Trana
  • 1,369
1

I don't see anything wrong with it, as long as it doesn't obscure the original purpose of commit messages - saying what the change is about. If you use those tools, why would you have anything against them being better integrated with each other?

If you get your CI integrated with the repository, so you can follow a single link from a broken build to the changelist that caused it, and from there to the issue ticket and code reviews of the change, it's simply a convenient shortcut for stuff you'd have to look up yourself anyway. I think we can agree on that.

This feature just takes it a step further. And while I wouldn't care that much for time tracking - it's not like it takes that much time to do it manually - creating or updating a review with a single line would be great.

scrwtp
  • 4,542