Last Updated: May 03, 2018
·
1.492K
· dimitrismistriotis

Calculate billable days from git logs

Having neglected to do proper book keeping, I had to retrieve which days I had worked for a client from git logs. Thank you github.

This is the shell pipe I run, in case anyone gets in the same situation:

git log --author=`git config user.email` | grep "^Date" | awk '{print $2 " "  $3 " " $4}' | uniq

3 Responses
Add your response

@jimmykane: No for two reasons: (1) Charging per day spent on client's location and (2) I might start working and commit after two hours, so I cannot deduce when I started working, if this makes sense.

over 1 year ago ·

Got it, to be honest, I don't believe it's feasible. Git is supposed to treat repositories separately, so I don't think you could pull over all projects you did on each single day. You can maybe do it on github (http://developer.github.com/v3/activity/events/#list-events-performed-by-a-user) - reminder: github is not git.

I tend to believe that what you want to do might be included in a piece of software that would not fit a Coderwall snippet.

Dyskolo

over 1 year ago ·

very nice! i'm totally going to steal and mod this. i'm always reconstructing billable hours through emails and chats. this is better

over 1 year ago ·