Write consistent git commit messages
stack build && stack install
Add a .cmt
file to your project directory.
cmt # will show the options and then commit
If you're using the ${*}
format option then:
cmt "blah blah blah" # this will go in ${*} place
A .cmt
file consist of two parts: the input parts and the output format.
For example, the AngularJS Commit Message Guidelines:
{
"Type" = [
"feat",
"fix",
"docs",
"style",
"refactor",
"test",
"chore"
]
"Scope" = @
"Subject" = @
"Body" = !@
"Footer" = !@
}
${Type} (${Scope}): ${Subject}
${Body}
${Footer}
These are at the top of the .cmt
file and surrounded by opening and closing curly braces. A consist of a name and a type:
@
: single line input!@
: multi line input["option 1", "option 2"]
: list of options
The output format consists of named input parts plus anything else you want.
You can accept a output called ${*}
, which will add in whatever is passed to cmt
as command line arguments.
For example:
{
"Scope" = @
}
(${Scope}): ${*}
Then use with:
cmt "Blah blah blah"