git-time-metric / gtm

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

How I can organize JIRA smart commits? #72

Closed max-mykhailenko closed 7 years ago

max-mykhailenko commented 7 years ago

Jira can collect spent time from commit messages. Commit message format should be issue-123 #time 1h 10m. Issue name I can get from current branch name, but how I can get time spent from last commit?

mschenk42 commented 7 years ago

In your pre-commit hook you can use gtm status --total-only. It doesn't match the time format for what Jira expects. I've been thinking about adding this option for a while. I'll put this at the top of the list. Need to first fix the Windows build, compiling C and Go together is not fun :).

mschenk42 commented 7 years ago

Information on Jira Smart Commits - https://confluence.atlassian.com/bitbucket/processing-jira-software-issues-with-smart-commit-messages-298979931.html#id-_smart_commits_commands1-time

mschenk42 commented 7 years ago

I've added the ability to output the time spent in a format that is compatible with Jira.

gtm status --total-only --long-duration 14 minutes

max-mykhailenko commented 7 years ago

Excellent! Thank you.