Skip to content

Commit c1f1215

Browse files
docs(git): improve docs for commit_preprocessors and commit_parsers (#928)
1 parent ab95626 commit c1f1215

2 files changed

Lines changed: 461 additions & 476 deletions

File tree

website/docs/configuration/git.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ a commit being treated as a changelog entry.
103103

104104
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.
105105

106+
:::note
107+
The `replace` or `replace_command` will take into account of the entire log of commit messages where the specified `pattern` is matched.
108+
:::
109+
106110
Examples:
107111

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

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

133+
> The above is equivalent to: `echo "<matched_part_of_the_changelog>" | pandoc -t commonmark`
134+
129135
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.
130136

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

139145
### commit_parsers
140146

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

143149
Examples:
144150

0 commit comments

Comments
 (0)