-
-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support a body template specifically for when there are no contributing commits #802
Comments
Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️ |
Hello! Thanks for the issue and sorry for the delayed response. I have implemented this as a configuration option ( Can you build from source and test it out if you are still interested? 🐻 |
Hi @orhun, thanks for the reply and the change. I built this branch and set the The relevant portion of my
If I run git-cliff when there are zero contributing commits at all (such as using
I say "sort of" because the version didn't get set, and verifying with If I run git-cliff when there are contributing commits, then I get the contributing commits and the version is working correctly, however I still have
Would I need to extend my condition to also check if Thanks again! |
Thanks for testing it! I pushed a new commit to that branch for fixing those cases, can you check again? 👀 |
Btw I renamed it to |
Oops closed by accident, feel free to let me know if there are issues. Going to include it in the next release now :) |
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: