git-time-metric / gtm

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

Accessing the tracked data outside of gtm #88

Closed gazsp closed 6 years ago

gazsp commented 6 years ago

I understand that gtm uses git notes to store the time tracking metrics, but how can I access the raw data myself, without using gtm? The use case would be taking the gtm data and feeding it into another program.

Is there some documentation on how to access the raw data and / or what the data format is?

Thanks in advance.

(P.S. I saw a comment somewhere on another issue about CSV / JSON export - that would be really useful!)

mschenk42 commented 6 years ago

Here's one way to get the raw data from the command line. It's a custom format.

git notes --ref gtm-data show HEAD

gazsp commented 6 years ago

Awesome. Any info on the format? ;-)

mschenk42 commented 6 years ago

Unfortunately I do not have anything written up. At times I wish I did :). The unmarshalling code may help you with that. https://github.com/git-time-metric/gtm/blob/master/note/note.go#L57

gazsp commented 6 years ago

Thanks for the info!