Presenting git timetracker

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 –author=foo@server.com –since=1week dir/file.c would tell you the time foo@server.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?

6 Responses to “Presenting git timetracker”


  1. 1 Karellen diciembre 6, 2010 a las 2:55 pm

    Minor nit – I’d have thought that ‘git timetrack start’ and ‘git timetrack stop’ would be more “git-like” than –start/–stop, as with git bisect {good,bad,…}, git stash {save,pop,…}, etc…

  2. 2 Karellen diciembre 6, 2010 a las 2:59 pm

    Also, your blog software appears to be changing a double-hyphen to an “en dash”, which, while possibly sometimes useful in an environment where beautiful typesetting is required and no document markup or arbitrary character selection is available, is absolutely the wrong thing on a technical forum.

    • 3 Nellerak diciembre 6, 2010 a las 4:15 pm

      It’d be fine to do on a technical forum if he provided a way to format arbitrary text as plain text, like with the tilde in Markdown or even using pre tags.

      • 4 Karellen diciembre 7, 2010 a las 2:07 am

        So, uh, if you want plain text without any kind of preprocessing or markup, you need to use markup to signify that, while if you want fancy preprocessing and special markup, you should just write in plain text?

        WTF?

        Surely, it would be easier that if you wanted an en-dash, you could just use markup and write –, and if you didn’t, you wouldn’t?

  3. 5 alpeb diciembre 31, 2012 a las 3:03 pm

    Thanks for this script!
    As a compatibility note, in Mac OS X for the –log command to work one needs to install gnu-sed and either replace the OS’ stock sed with it, or change “sed” by “gsed” in the git-timetrack script.


  1. 1 hair styling Trackback en febrero 18, 2016 a las 5:55 am

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s





A %d blogueros les gusta esto: