Skip to content

Commit

Permalink
docs(git): improve docs for commit_preprocessors and commit_parsers (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad-Owais-Warsi authored Nov 3, 2024
1 parent ab95626 commit c1f1215
Show file tree
Hide file tree
Showing 2 changed files with 461 additions and 476 deletions.
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

0 comments on commit c1f1215

Please sign in to comment.