jazzband / Watson

:watch: A wonderful CLI to track your time!
http://tailordev.github.io/Watson/
MIT License
2.44k stars 239 forks source link

Feature: watson git support #422

Open IJustDev opened 3 years ago

IJustDev commented 3 years ago

I am developing a project right now with a friend of mine and I use watson to do my time tracking within this project, so thank you community for this beautiful cli!

With this issue I want to request a git support for the watson cli. In order to understand what exactly is my request I will tell you something about the background and how it would be used.

Background

I've created a project "window-manager" in watson for example. Each issue managed by GitLab/GitHub/Jira is a tag in my case. So my watson log looks something ilke that:

Thursday 08 April 2021 (2h 31m 16s)
        bd12269  10:46 to 11:28      41m 50s  window-manager   [15]
        3828b79  14:40 to 15:50   1h 10m 26s  window-manager [15]
        a3c28d5  22:36 to 23:15      39m 00s  window-manager   [4]

I want the watson log to add a new field containing the commit shas to be displayed next to the watson sha.

We could get these commits one worked on by checking the current project for all commit messages containing the watson sha.

DeD1rk commented 2 years ago

I'm a bit confused about how this would work exactly: how are the hashes linked to specific watson log entries? Manually adding them seems too difficult.

One solution I could imagine is adding functionality like watson log --commits-from="git repo" where it takes existing log entries, and annotates each of those with the commits made in their time ranges. But there can then be many commits in one log entry.

A more (very) challenging feature would be something like watson watch-git <repo>, which could somehow keep track of what you do in a local git repo, automatically creating watson entries for example when you git checkout or commit. But this would be very complicated and might not work nicely.