1
1
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:
Muhammad Owais Warsi 2024-11-03 22:21:57 +05:30 committed by GitHub
parent ab95626394
commit c1f12154e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 458 additions and 473 deletions

View File

@ -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