Giter Site home page Giter Site logo

auto-smart-commit's Introduction

Auto Jira smart commit

This pre-commit hook transforms your Git commit messages into Jira smart commits.

If your branch name contains a Jira issue key such as ABC-123, the hook will automatically format your commit message into a Jira smart commit:

Command Log entry
git commit -m "release the kraken." ABC-123 Release the kraken

ABC-123 #time 0w 0d 2h 8m Release the kraken

Effect: Logs the time since your last commit on any branch in the Work Log tab.
git commit -m "Release the kraken

A kraken lives in dark depths, usually a sunken rift or a cavern filled with detritus, treasure, and wrecked ships."
ABC-123 Release the kraken

ABC-123 #comment A kraken lives in dark depths, usually a sunken rift or a cavern filled with detritus, treasure, and wrecked ships.

ABC-123 #time 0w 0d 2h 8m Release the kraken

Effect: Posts a comment to the Jira issue and logs the time since your last commit in the Work Log tab.

If the branch name does not contain a Jira issue key, the commit message is not modified. The time logged takes into account non-working hours such as lunch breaks and nights.

See How to Write a Git Commit Message for an explanation of the seven rules of a great Git commit message:

  1. Separate subject from body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line (automated)
  4. Do not end the subject line with a period (automated)
  5. Use the imperative mood in the subject line
  6. Wrap the body at 72 characters
  7. Use the body to explain what and why vs. how

Installation

Add the following to your .pre-commit-config.yaml file:

repos:
  - repo: https://github.com/radix-ai/auto-smart-commit
    rev: v1.0.2
    hooks:
      - id: auto-smart-commit

and make sure to run pre-commit install --hook-type prepare-commit-msg to install the hook type necessary for this hook.

auto-smart-commit's People

Contributors

jakegroves avatar lsorber avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.