/timesheet-githook

Asks how long your commit took you to code then logs that amount of time in the corresponding JIRA ticket

Primary LanguageShell

Timesheet Githook

Asks how long you worked on a commit then logs that amount of time to the corresponding JIRA ticket. Feel free to log issues or send PRs. Here is the blog post if you'd like a walkthrough of the code or if you would like to leave comments, suggestions or share experiences.

Example

example

Setup

Clone the Post Commit Hook

  • Steps
    1. Open your terminal and change directory to your github repository cd my-github-repository
    2. Run this command to change your directory to your git hooks folder (you need the back ticks) `git rev-parse --git-dir`/hooks
    3. Copy the git hook with this command wget https://raw.githubusercontent.com/msolomonTMG/timesheet-githook/master/post-commit && chmod +x post-commit
    • Be sure to change the JIRA url if you are not from my organization :)

Usage

  • When you commit on a branch that has a JIRA ticket in the name and you do not log time through a smart commit, a message will pop up asking how long that commit took to code.
  • Answer the question in this format:
    • 1d (for one day)
    • 2h (for two hours)
    • 30m (for thirty minutes)
    • 1h 10m (for one hour and ten minutes)

Notes

  • I welcome pull requests to make this better!
  • I want an update to not show the message if the commit is a merge