Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/se/bjurr/gitchangelog/api/helpers/Helpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ public static Map<String, Helper<?>> getAll() {
(final Commit commit, final Options options) -> {
return conditional(options, commitScope(commit, options));
});
helpers.put(
"ifCommitTypeOtherThan",
(final Commit commit, final Options options) -> {
return conditional(options, !commitScope(commit, options));
});

helpers.put(
"ifCommitHasFooters",
Expand Down
14 changes: 13 additions & 1 deletion src/main/resources/changelog-prepend.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
### Other changes

{{#commits}}
{{#ifCommitType . type='^$'}}
{{#ifCommitType . type='^($^|(?!fix|feat|breaking|chore).*)'}}
**{{{messageTitle}}}**

{{#messageBodyItems}}
Expand All @@ -55,6 +55,18 @@

[{{subString hash 0 5}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}) {{authorName}} *{{commitTime}}*

{{/ifCommitType}}
{{#ifCommitType . type="chore"}}
{{#ifCommitTypeOtherThan . scope="deps"}}
**{{{messageTitle}}}**

{{#messageBodyItems}}
* {{.}}
{{/messageBodyItems}}

[{{subString hash 0 5}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}) {{authorName}} *{{commitTime}}*

{{/ifCommitTypeOtherThan}}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to make sure the chores that aren't dependency updates are included in the list, as the chore(deps) were included in Dependency updates section

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably means you should have your own complete template. I personally dont want the chores in the changelog.

{{/ifCommitType}}
{{/commits}}

Expand Down
16 changes: 14 additions & 2 deletions src/main/resources/changelog.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Changelog of {{repoName}}.
### Other changes

{{#commits}}
{{#ifCommitType . type='^$'}}
{{#ifCommitType . type='^($^|(?!fix|feat|breaking|chore).*)'}}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#ifCommitType . type='^$' expects the commit type to be empty. By using the same expression as line 50, we can include both empty types, and other types such as refactor:, docs:, etc.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would encourage all users to create their own custom template and adjust it exactly as they want. All tools using this library should offer that feature.

**{{{messageTitle}}}**

{{#messageBodyItems}}
Expand All @@ -60,9 +60,21 @@ Changelog of {{repoName}}.

[{{subString hash 0 5}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}) {{authorName}} *{{commitTime}}*

{{/ifCommitType}}
{{#ifCommitType . type="chore"}}
{{#ifCommitTypeOtherThan . scope="deps"}}
**{{{messageTitle}}}**

{{#messageBodyItems}}
* {{.}}
{{/messageBodyItems}}

[{{subString hash 0 5}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}) {{authorName}} *{{commitTime}}*

{{/ifCommitTypeOtherThan}}
{{/ifCommitType}}
{{/commits}}

{{/ifContainsType}}
{{/ifEquals}}
{{/tags}}
{{/tags}}
Loading