Every now and then I forget to stop time tracking and can’t remember when I left the office (especially after weekends). So normally I just consult git logs via git-standup. That works pretty nice because you should always check in your stuff before you leave.

But as you may already guessing sometimes I manage to even forget about that, like today. To solve the issue I assume that my last save of a source file relates roughly to when I left the office.

So I came up with this:

$ git status -s | sed -nr 's/ M (.)/\1/p' | xargs stat -c %y

The git status -s | sed -nr 's/ M (.)/\1/p' part will return a list of files with uncommitted changes. The following xargs stat -c %y prints modification time for each file.