Logging code commits with Nomie
I use Nomie to track almost all things. For a long time I wanted to log my commits so I can do some analysis specially where do I code most. So as soon as I got the Nomie API key I created post commit hooks to log.
# create global hook templates git config --global init.templatedir '~/.git-templates' mkdir -p ~/.git-templates/hooks # Edit or create post hook nano ~/.git-templates/hooks/post-commit #Add the line to send the message and save the file curl -s https://api.nomie.io/v2/push/<API_KEY>/action=track/label=Code/charge=1 > /dev/null # make it executable chmod a+x ~/.git-templates/hooks/post-commit ### reinit so the hooks are copied to the specific git repo git init
Once the post-commit hook is added. You need to “git init” for existing projects. It automatically gets added to new projects when you do init.
Its much easier with mercurial. Just add it to the global .hgrc. The hook automatically applies to all the existing projects and new ones. If you want it only for specific project then edit the specific project hgrc.
# Edit global .hgrc nano ~/.hgrc #add the hook under [hooks] [hooks] commit = curl -s https://api.nomie.io/v2/push/<API_KEY>/action=track/label=Code/charge=1 > /dev/null
Nomie gives you some graphs by default but you can create your own as the data is available.