Damn, it’s been a while since last post, again. Anyway, I’m here to present you a new git tool I’ve been working on together with Daniel (danigm): the new git timetrack comand, part of the distributed time tracker project. It allows you to track the time spent in commits done to a git repository.
It’s quite simple to use: you do a git timetrack –start, the clock starts counting. Then you go for a coffee, you use git timetrack –stop for that, and then when you come back, you can continue counting the time executing git timetrack –start. Then you do a commit, and it gets automatically annotated with the time spent, and the clock stops counting. Some random notes:
- To start using git timetrack, you need to first execute git timetrack –init in your project to add the needed hooks and options to .git/config.
- The time annotations will appear in git log in seconds, and will be shown more nicely when using git timetrack –log.
- If you forgot to start tracking the time for a commit, you can execute git timetrack –set X to set the clock to X minutes, and then continue counting the time with git timetrack –stop. And if you messed the time and want to start from zero, you can do a git timetrack –reset (or git timetrack –set 0).
- You can add an estimation of the time you spent in last commit with git timetrack –set X and then “amending” the commit (adding the times-pent) with git timetrack –amend. Using that, you can also change the time spent in last commit, and you can also change/set the time spent in any commit giving the commit-ref to the –amend option.
- For consulting how much time have you been currently spent in next commit (i.e. the status of the stopwatch), use git timetrack –current.
- For consulting the time spent in the project, use git timetrack –summary . It internally makes use of git log, and allows the same options as git log, so git timetrack –summary –firstname.lastname@example.org –since=1week dir/file.c would tell you the time email@example.com spent in dir/file.c since last week.
- If you’re going to start hacking and thus do a batch of commits, you might not want to execute git timetrack –start to start counting the time after each commit. That’s automatically done for you if you use the properly named option git timetrack –start-hacking!
- List all the options available with git timetrack -h.
Git timetracker uses Git notes to add time-spent annotations to commits. That means that thos annotations do not modify the commits and leave them intact, and are stored in a git notes branch instead. Git notes itself is quite recent and git timetracker requires git-next (git development unstable branch) because it makes use of the git notes merge feature to be able to share the timetracker notes between users and merge changes on it nicely.
Why did we develop timetracker? We are creating a small software company called Wadobo, and we needed to do (rough) estimations of the time the development in the projects we work on will take, so we thought that the first thing we needed is having some real information about time spent in those projects.
I think that this can be really useful for the mentioned usecase. The tool is quite new but works-fine-for-me (TM) and we’ve been using it for a project for nearly two weeks already. Hopefully you like this little gem from us.
PS: I wanted to do a screencast, I really tried, but boy is that a difficult task to do. ffmpeg is segfaulting (I don’t use/have pulse audio but directly alsa). xvidcap is not capturing audio in the arch linux binary, and it’s diffcult to compile. recordmydesktop gives me audio artifacts. aur/screencast is not compiling… I gave up, have better things to do. What tools would you recommend to me?