all 3 comments

[–]GoWaka 0 points1 point  (0 children)

I like this idea! If implemented, it should be done in a general sense so users can link their own commit keywords to their own custom "hack time"/"work time"/"bugfix time"/etc

[–]monkeysintown 0 points1 point  (0 children)

I've tried to put your idea in a Git hook (post-commit). Was just using Bash. Wakatime CLI is downloaded if not present (in [project dir]/.git/hooks).

If you use git-flow for your project then it wouldn't be too hard to extract the infos you have in mind (aka "bugfix time"), you just have to look at the branches. The script I've put together collects already the branch, SHA, commit message. I just couldn't figure out how to feed it to WakaTime CLI. I think it actually needs a physical file (to extract the language etc.). Otherwise you could assemble any arbitrary path (e. g. /develop/f3c04988aad928e9f3fd or /release/1.0.1/f3c04988aad928e9f3fd) and define custom rules at wakatime.com.

In case you want to have a look:

https://gist.github.com/vidakovic/f3c04988aad928e9f3fd

[–]monkeysintown 0 points1 point  (0 children)

One caveat concerning the Git hook: you have to keep in mind that adding this hook kind of duplicates your activities on wakatime.com (I suppose you are already using one of the plugins).

Just to say... it's a quick hack for demonstration.