-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Allow specifying version and date for unreleased changes #72
Comments
Hello! Have you tried |
I'm using this repository. Note that not all commits are in conventional format since I'm forking a new project and there are things I don't want in the changelog quite yet.
What I want is something that will cut a release for the untagged v0.2.0, create the changelog with all entries, include unversioned commits as if they're part of this new version, let me commit/tag the release locally, and then CI does the publish. Or maybe some other combination thereof, but right now I can't even generate the next release's changelog. Thanks. |
None of the commits in that repo since v0.1.1 have any conventional-commit log messages. You'll need to setup custom commit message processors to handle your commit message pattern, whatever it is or manually handle the change log for those commits. The reason it generates anything at all for v0.1.0 and v0.1.1 is that there are a handful of conventional-commit compliant messages mixed in there. |
OK, got it to work if I a) added a conventional commit message and b) dropped I wonder if the --tag option might be changed to clarify that it doesn't need to explicitly specify an existing tag? Maybe add a --current_version/--new_version synonim to make it clearer that you can also specify a version matching the pattern? I've just been assuming that it has to be an existing tag, and that I'd at least get an empty changelog message or something if I'd done it right. Thanks. |
One more quick question. How do I access the current date in a template? Sometimes the date that I make a release isn't the date that I made the last commit. Still getting the hang of Conventional Commits, but I'm wondering if the current date is exported as a template variable? Thanks. |
You can use |
Is your feature request related to a problem? Please describe.
I want to use git-cliff with cargo-release. Unfortunately there seems to be a bit of a chicken and egg problem in that cargo-release wants to own the tagging process, but git-cliff expects the tag to be added already. So if I want to maintain a project with conventional commits, and generate the changelog as part of the crate, git-cliff generates a changelog as if the newest changes are unreleased, and cargo-release then tags the final release.
Describe the solution you'd like
I'd like to specify versions and an optional date, defaulting to today, for the unreleased section of the changelog. cargo-release exposes these in the environment, so my pre-release hook should be able to generate the changelog and commit the changes as part of its pre-release hook.
Describe alternatives you've considered
I've tried using cargo-release's file processing, but I think this happens before the pre-release hook runs so it wouldn't have access to the new changelog anyway. This may be doable with cargo-release as is, but there's a lot of unclear documentation there, and it just seems easier if I could specify a next tag/date on the command line or in the environment. It might even make sense to adopt cargo-release's conventions as is for these, so running git-cliff directly from a pre-release hook picks up the correct information automatically. The relevant cargo-release environment variable is:
NEW_VERSION
: The current (bumped) crate version.I'm guessing it just defaults the date to today's, which seems sensible for both.
Additional context
Maybe there's a way to do this already, but I haven't found it. Thanks!
The text was updated successfully, but these errors were encountered: