If you use Git for version controlling some projects of yours and you are a number-crunch fanboy, you might be interested to know which hours you (or some fellows in your team) are active the most. I mean which hours during the day you do your commits. This is onliner will do this for you. Run it from inside your project dir:

git log –committer=”Dimitris Kalamaras” –pretty=”%cd” | cut -d’ ‘ -f4 | cut -d: -f1 | sort -n | uniq -c

You’ ll see something like the following. The first column is the number of the commits per hour, while the second column is one the 24 hours of the day.


dimitris@localhost:~/socnetv/trunk$ git log --committer="Dimitris Kalamaras" --pretty="%cd" | cut -d' ' -f4 | cut -d: -f1 | sort -n | uniq -c
66 00
37 01
29 02
8 03
1 04
2 05
1 06
9 07
17 08
18 09
24 10
29 11
48 12
52 13
57 14
62 15
47 16
52 17
51 18
72 19
71 20
59 21
107 22
85 23

Yep. Apparently, I do commit to SocNetV mostly between 21.00 and 01.00… Need to change habits.

Our thanks for this nice oneliner go to Linus 🙂