Support a body template specifically for when there are no contributing commits #802
Open
1 task done
Labels
feature/request
New feature or request
Is there an existing issue or pull request for this?
Feature description
In the case where no commits contribute to the new version, which is fairly likely with
--include-path
and monorepos, thebody
template is apparently not evaluated at all. Then when the changelog is modified (for example with--prepend …
) no changes occur, and then there is nothing to stage, whichgit commit
doesn't like and will exit with a non-zero status.Desired solution
A template specifically for the case where there are in fact no commits contributing, then it would be possible to still output a changelog for this, which would a) record the new version's existence and b) be explicit about the fact that there are no changes.
Alternatives considered
Alternative 1:
git commit --allow-empty
This is the workaround we opted for, but unfortunately it means the version isn't recorded at all in the changelog.
Alternative 2: Reuse the existing
body
templateRequiring everyone to cater for branching on zero commits is breaking the current contract for the
body
template, and seems slightly annoying to write the template for.Additional context
I'm basing my assumption that
body
isn't run at all by placing some literal text at the very top ofbody
and noting that it does not appear in the changelog until I remove filters/include paths to eventually include at least one commit.The text was updated successfully, but these errors were encountered: