This post is older than a year. Consider some information might not be accurate anymore.
Used: git v2.17.1 gtm v1.3.5
Working at mimacom is colourful and enriching if you use the drink breaks to exchange knowledge or get co-workers to know much better. Our management and working culture explicitly desire that. This blog post is the result of it.
Johan Wannheden, our Senior Software Architect, and I talked a little bit about the daily chores as a consultant. One of the tasks is keeping track of the activities you did for the customer. Time tracking is simply the measurement and documentation of hours worked. Every consultant is free to do as she or he likes.
There are several methods of time tracking:
- Using pen and paper - the paper method
- Using a rule of thumb or estimate - the honour method
- Using M$ Excel or Google Tables - the spreadsheet method
- Using software - the software method
Each technique works. We shared our experience, and he came across the challenging difficulties of the first three methods. I use 2-5 minutes per day or week for that. It doesn’t matter. He was surprised by that number and asked me how I manage that.
Obviously, as a software engineer or geek, I go with the software method. My weapon of choice is git. Git is a distributed version control system for tracking changes in source code during software development. By design, it is for coordinating work among programmers, but it can be used to track changes in any set of files. If I can keep track of changes, I utilise that for my time tracking. Kill two birds with one commit.
Using Smart Commits in Jira
As software engineers, we tend to love our tools more than our partners in real life. Jira is the software I hate, but they did one thing right. I can use smart commits with git. By using special commands, called Smart Commits, in your commit messages, you can record time tracking information against issues.
For instance, following commit message, will automatically update my Jira issue with a work log. Our work philosophy is, do nothing without a Jira issue!
DF-1905 #time 1w 2d 4h 30m Example work entry logged
One major critic of seasoned and badass developers are, you pollute the git messages and misuse it. That isn’t version control we all aspire. So what? Being pragmatic isn’t a sin, but from philosophy, it is true. There is a silver lining to that situation.
Git Time Metric
Git notes store additional metadata to the commit. It will not change the current branch, and the time-tracking metadata has a clean separation from the source code changes.
Since everything is work-related in my projects, I can always generate the reports conveniently with all my numbers for our bookkeeping.
This command will yield a monthly summary (picture from the open source project).
$ gtm report -last-month -format summary
This command shows a timeline.
$ gtm report -last-month -format timeline-hours
I can integrate Git Time Metric with my favourite editors like IntelliJ, Atom and many more. I don’t have to leave my IDE and have minimal context switch at my work.
Be more efficient and let Git Time Metric track your time or use Smart Commits to avoid the stress of time tracking. As a developer, you spend most of the time in your IDE anyway. Below you can see the report for writing this blog post.
There is one pleasant context switch you can not avoid: The coffee break with your co-workers. Have fun multiplying the insights gained through coffee breaks.