import { type Options } from "https://deno.land/x/commit@0.1.5/mod.ts";
Properties
Pattern to match merge headers. EG: branch merge, GitHub or GitLab like pull requests headers. When a merge header is parsed, the next line is used for conventional header parsing.
For example, if we have a commit
Merge pull request #1 from user/feature/feature-name
feat(scope): broadcast $destroy event on scope destruction
We can parse it with these options and the default headerPattern:
{
mergePattern: /^Merge pull request #(\d+) from (.*)$/,
mergeCorrespondence: ['id', 'source']
}
Used to define what capturing group of mergePattern
.
If it's a string
it will be converted to an array
separated by a comma.
Used to match header pattern.
Used to define what capturing group of headerPattern
captures what header
part. The order of the array should correspond to the order of
headerPattern
's capturing group. If the part is not captured it is null
.
If it's a string
it will be converted to an array
separated by a comma.
Keywords to reference an issue. This value is case insensitive. If it's a
string
it will be converted to an array
separated by a comma.
Set it to null
to reference an issue without any action.
The prefixes of an issue. EG: In gh-123
gh-
is the prefix.
Used to define if issuePrefixes
should be considered case sensitive.
Keywords for important notes. This value is case insensitive. If it's a
string
it will be converted to an array
separated by a comma.
Pattern to match other fields.
Pattern to match what this commit reverts.
Used to define what capturing group of revertPattern
captures what reverted
commit fields. The order of the array should correspond to the order of
revertPattern
's capturing group.
For example, if we had commit
Revert "throw an error if a callback is passed"
This reverts commit 9bb4d6c.
If configured correctly, the parsed result would be
{
revert: {
header: 'throw an error if a callback is passed',
hash: '9bb4d6c'
}
}
It implies that this commit reverts a commit with header 'throw an error if a callback is passed'
and hash '9bb4d6c'
.
If it's a string
it will be converted to an array
separated by a comma.
What commentChar to use. By default it is null
, so no comments are stripped.
Set to #
if you pass the contents of .git/COMMIT_EDITMSG
directly.
If you have configured the git commentchar via git config core.commentchar
you'll want to pass what you have set there.