Skip to content

Latest commit

 

History

History
62 lines (33 loc) · 1.97 KB

README.md

File metadata and controls

62 lines (33 loc) · 1.97 KB

prepare-commit-msg-jira

GoDoc

Build Status

Prepares a git commit message from a Jira issue by fetching the summary and description and formatting in a way that is appropiate for a git commit message. It identifies the Jira ticket number from the name of the git branch that you are on.

You should install it in your .git/hooks/ directory as 'prepare-commit-msg'.

It uses the following git configuration items:

- jira.url - this is the base url of the jira service.  It should
             have a trailing '/'

- jira.regexp - this is a regular expression that extracts the issue
                name from the git branch name.

- jira.jsessionid - this is the value of the JSESSIONID cookie that
                    jira sets after you login.  Get this from your
                    browser.

You should set these git configuration items like this:

git config --add jira.url <a href="https://jira.atlassian.com">https://jira.atlassian.com</a>

If it cannot extract the ticket number from the branch or it cannot find the ticket number in Jira, then the default git commit message will be used.

It only prepares a commit message for "normal" commits. It leaves the git default commit message for ammend, --C, merge, and -m"msg" style commits.

It applies the following format for the git commit message:

TICKET-12345: The summary line

Descriptive text is wrapped at 76 characters.  This is a really long
line to get the point across.

    Text that is within the {noformat} directive is included without wrapping but is indented by 4 spaces

Patches (with unit tests) are welcome to improve authentication, enhance the formatting, etc.


Generated by godoc2md