mirror of
https://github.com/orhun/git-cliff.git
synced 2024-11-29 03:23:13 +03:00
docs(git): improve docs for commit_preprocessors and commit_parsers (#928)
This commit is contained in:
parent
ab95626394
commit
c1f12154e7
@ -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"}`
|
||||
@ -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:
|
||||
@ -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:
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user