Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs imporovement in commit_preprocessors and commit_parsers #928

Merged
merged 4 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion website/docs/configuration/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ a commit being treated as a changelog entry.

An array of commit preprocessors for manipulating the commit messages before parsing/grouping them. These regex-based preprocessors can be used for removing or selecting certain parts of the commit message/body to be used in the following processes.

:::note
The `replace` or `replace_command` will take into account of the entire log of commit messages where the specified `pattern` is matched.
:::

Examples:

- `{ pattern = "foo", replace = "bar"}`
Expand All @@ -126,6 +130,8 @@ Custom OS commands can also be used for modifying the commit messages:

- `{ pattern = "foo", replace_command = "pandoc -t commonmark"}`

> The above is equivalent to: `echo "<matched_part_of_the_changelog>" | pandoc -t commonmark`

This is useful when you want to filter/encode messages using external commands. In the example above, [pandoc](https://pandoc.org/) is used to convert each commit message that matches the given `pattern` to the [CommonMark](https://commonmark.org/) format.

A more fun example would be reversing each commit message:
Expand All @@ -138,7 +144,7 @@ A more fun example would be reversing each commit message:

### commit_parsers

An array of commit parsers for determining the commit groups by using regex.
An array of commit parsers for determining the commit groups by using regex. The entire commit messages are affected wherever the regex is matched.

Examples:

Expand Down
Loading
Loading