Simple time logging on top of git flow

My current team found out that we should have tracked some time over the last year.
Extracting timelogs in retrosepct is not fun. Git helps a lot, combined with chat-logs from Slack, Google Calendars will give a good basis. A day of grep, sed, and awk, and you have some time-logs.

I decided that from now on, I want to track what I start and finish working on in a basic log. And I am using git with
git-flow by Peter van der Does, which is what you get when you
apt-get install git-flow. This allows special git-flow hooks.

I want this to write logs to a simple textfile. But have a place where I could call external APIs to insert some tracking data into external trackers, when my team uses these.

The result is certainly not a replacement for actual timetracking. But a log that will aide with answering "when did you work on what?".

It requires you to work with git-flow and use feature branches for everything. But you should use topic branches anyway.

Git-flow triggers its own hooks. So just create a simple utility script that is exectuable and logs an activity, or calls an external API or whatever you are using. Then call that script from the git-flow hooks.

Note that, as far as I can tell, the upsteam git-flow by nvie himself, does not
have own git-hooks. Peter van der Does' fork
has this. Which is also the source used for the Debian package (so also for
Ubuntu).

Write that to e.g. ~/bin/log-git-flow-feature and make executable with
chmod +x ~/bin/log-git-flow-feature.

Note: when you create scripts with git-foo
a subcommand git foo is made available. You probably don't want to name this
script git-flow-log-feature or so, to prevent git flow log from becoming
a command.

Now just add two hooks and make them exectuable. This will add hooks to a specific
git repo:

About the author: Bèr Kessels is an experienced webdeveloper with a great passion for
technology and Open Source. A golden combination to implement that technology in a good and efficient
way. Follow @berkes on Twitter. Or read more about Bèr.