git-time-metric / gtm

Simple, seamless, lightweight time tracking for Git
MIT License
979 stars 52 forks source link

Extracting time metrics from an existing repository ? #108

Open beppe9000 opened 4 years ago

beppe9000 commented 4 years ago

Is this possible ?

kilpkonn commented 4 years ago

What is exactly you want to do? You can fetch previously recorded time with git fetchgtm. If you have not recorded any data to repo, then can't extract it. I might have misunderstood your question tho

beppe9000 commented 4 years ago

I basically would like to start using gtm but I have an existing repository, not a new one. So in addition to start recording with gtm I would like to pre-seed it with a per-user estimate/approximation of time already spent on the project based on the versioning informations alone. But I guess I might be out of luck... or can you point me to any script of such kind ?

kilpkonn commented 4 years ago

Yeah, you can start with gtm init, and then manually add times for one of previous comments etc. but it's more of a manual work as far as I know. Also it might not be good for statistics as it would make one commit time huge for every developer.

beppe9000 commented 4 years ago

one way i was thinking is finding groups of commits within x minutes of each other by the same author and counting the time between the first and the last commit to be then added with gtm. aferward an approximation could be made to figure the "developer speed" from the clusters of commits and the amount of changes and then apply it to the "change size" of the remaining isolated commits. I would like to see something like gtm init --estimate for accomplishing this, so if you have any ideas or consideration please tell me.

I will probably end up making a separate tool, but I think this will be also a way to try my hand at Go if I can add it to this project :)