Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can I report Work Time in git commit messages?

Alex Satrapa October 9, 2013

Say I have an issue, "As a Jira & Stash user, I want to be able to update Jira issues with time spent when committing changes using git." This is issue SAU-34 as part of the Sunshine and Unicorns project.

If I perform some work and have a git repository with changes staged for a commit, I might commit with this message:

git commit -m "Recognising limited 'work spent' formats in git commits as part of SAU-34."

At present, the linkage is in place between the Jira issue SAU-34 (through the Source messages at the bottom of the issue details page) and Stash (though the automatic link generated on recognition of SAU-34 as an issue identifier).

Is there a possibility to enhance this linkage such that a commit of the form:

git commit -m "Recognising limited 'work spent' formats in git commits as part of SAU-34. Effort: 3h 25m."

Would not only provide linkage between Stash and Jira, but would also update Jira issue SAU-34 with 3:25 of effort, by default reducing the remaining estimate by the same amount of time?

I've tried searching through these answer/questions for terms such as work, effort, jira, stash, but either the issue hasn't been raised before or my Atlassian-Question-Fu is weak.

4 answers

1 accepted

0 votes
Answer accepted
Alex Satrapa October 21, 2013

I have found one option here (the Smart Commits mentioned in Charles O'Farrell's message, which implements the functionality used by Christian Gagneraud's suggestion): https://confluence.atlassian.com/display/AOD/Processing+JIRA+issues+with+commit+messages

Another option is to use a local commit hook in combination with Bob Swift's Jira CLI: https://bobswift.atlassian.net/wiki/display/JCLIP/CLI+Plugin+for+JIRA

Using the Jira CLI + local commit hook avoids the issues mentioned by Charles O'Farrell, but does require access to Jira at the time the commit is made (thus you cannot include work effort in commits made while offline).

1 vote
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 9, 2013

Hi Alex,

I think you're looking for 'smart commits':

https://jira.atlassian.com/browse/STASH-2490

I'm not going to lie though - it's not something we're very interested in implementing at the moment. The reasons are due to the nature of Git and DVCS. For example. If you push to a fork repository, with a commit that contains your commit message, and then you merge to the parent repository, would you want the time to update again? Or delete the branch and then re-create it? What happens if you delete the repository or migrate to another Stash instance? It's a tricky problem to solve, and one that we would prefer to tackle with stronger/smarter integration with JIRA.

That said I suspect someone will inevitably implement it as a plugin, and I recommend watching the issue above for news and updates.

Cheers,

Charles

0 votes
Tom Jackson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 25, 2014
0 votes
Christian Gagneraud October 9, 2013

If I'm not wrong, you can do it this way:

git commit -m "SAU-34 #time 3h 25m Blah Blah Blah "

Alex Satrapa October 9, 2013

This doesn't appear to be working for our Stash/Jira installation. Any idea what add-ons, plugins or configuration you have that might be enabling this functionality?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events