git-hook-jira-id

0.0.0 • Public • Published

git-hook-jira-id

A git hook for prefixing jira id in every commit message

It's for husky users

Installation

for NPM users:

npm i git-hook-jira-id -D

for YARN users:

yarn add git-hook-jira-id --dev

CLI Usage

Usage:
  $ git-hook-jira-id [options]

Options:
  -p, --prefix <prefix>  jira prefix
  -i, --interactive      interactive
  -h, --help             Display this message
  -v, --version          Display version number

prefix

It's used for matching jira id from your branch name

for example

git-hook-jira-id -p ABC

Internally it will use /ABC-\d+/i for searching jira id

interactive

If you want to prefix jira id case by case

interactive may be your best choice

Guide for husky users

  1. without --interactive, it will add jira id for every commit, it's simple but powerful
"husky": {
  "hooks": {
    "prepare-commit-msg": "git-hook-jira-id -p KJDS"
  }
}
  1. with interactive, you can make your own decision for every commit
"husky": {
  "hooks": {
    "prepare-commit-msg": "exec < /dev/tty && git-hook-jira-id -p KJDS -i || true"
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i git-hook-jira-id

Weekly Downloads

0

Version

0.0.0

License

ISC

Unpacked Size

4.83 kB

Total Files

5

Last publish

Collaborators

  • fengzilong