-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(parser): allow whole commit context to be used in commit parsers (…
…#758) * fix: reorder execution to have context poplulated before parsing/pruning * feat: allow field to read from context object * fix: add tests * fix: add legacy fix for body field * test: add fixture * docs: update documentation * refactor: clean up implementation --------- Co-authored-by: Orhun Parmaksız <[email protected]>
- Loading branch information
1 parent
85bfa95
commit ccf2ab7
Showing
8 changed files
with
155 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[changelog] | ||
header = """ | ||
# Changelog\n | ||
All notable changes to this project will be documented in this file.\n | ||
""" | ||
body = """ | ||
### What's changed | ||
{% for group, commits in commits | group_by(attribute="group") %} | ||
#### {{ group }} | ||
{% for commit in commits -%} | ||
- {{ commit.message }} | ||
{% endfor -%}\n | ||
{% endfor %}\n | ||
""" | ||
footer = """ | ||
<!-- generated by git-cliff --> | ||
""" | ||
trim = true | ||
|
||
[git] | ||
commit_parsers = [ | ||
{ field = "author.name", pattern = "testa", group = "<!-- 0 -->TEST A" }, | ||
{ field = "author.name", pattern = "testb", group = "<!-- 1 -->TEST B" }, | ||
{ field = "author.name", pattern = "testc", group = "<!-- 2 -->TEST C" }, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
GIT_COMMITTER_DATE="2022-04-06 01:25:08" git commit --allow-empty -m "Initial commit" | ||
GIT_COMMITTER_DATE="2022-04-06 01:25:09" git commit --allow-empty --author="testa <[email protected]>" -m "feat: add feature 1" | ||
GIT_COMMITTER_DATE="2022-04-06 01:25:10" git commit --allow-empty --author="testa <[email protected]>" -m "feat: add feature 2" | ||
GIT_COMMITTER_DATE="2022-04-06 01:25:11" git commit --allow-empty --author="testb <[email protected]>" -m "feat: add feature 3" | ||
GIT_COMMITTER_DATE="2022-04-06 01:25:12" git commit --allow-empty --author="testb <[email protected]>" -m "feat: add feature 4" | ||
GIT_COMMITTER_DATE="2022-04-06 01:25:13" git commit --allow-empty --author="testc <[email protected]>" -m "feat: add feature 5" | ||
GIT_COMMITTER_DATE="2022-04-06 01:25:14" git commit --allow-empty --author="testc <[email protected]>" -m "feat: add feature 6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
### What's changed | ||
|
||
#### <!-- 0 -->TEST A | ||
- add feature 1 | ||
- add feature 2 | ||
|
||
#### <!-- 1 -->TEST B | ||
- add feature 3 | ||
- add feature 4 | ||
|
||
#### <!-- 2 -->TEST C | ||
- add feature 5 | ||
- add feature 6 | ||
|
||
<!-- generated by git-cliff --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters