Skip to content

Using shorter versions ( v1.5 ) will add a 0 patch when not desired #292

Closed

Description

@bephinix

Description
Updating from v1.3.0 to v1.6.0 I have noticed that the patch version is appended by the patch command if not specified.
As I am using a simplified form of SemVer vX.Y for various projects, this breaks the current workflow.
If this is intended, this should be converted to a feature request to be able to disable this behaviour.

Reproduction Steps
Steps to reproduce the behavior:

  1. Run changie batch v2.5.

What happened
v2.5.0.md is created for version v2.5.0.

Expected behavior
v2.5.md is created for version v2.5.

Activity

  1. changed the title [-]Enforcing of Patch Verson might not be desired[/-] [+]Enforcing of Patch Version might not be desired[/+] on Mar 19, 2022
  2. miniscruff commented on Mar 19, 2022

    @miniscruff
    Owner

    Hmm, yes it does seem to be a regression after adding in support for prerelease and meta options. The semver tool uses the .String() method instead of .Original() so it appends a zero patch. I have a fix for this but want to add that if you do changie batch v1.5 --prerelease rc1 the result will include the patch of 0: v1.5.0-rc1 which probably does not affect you but just a special case.

    v1.6.1 coming up

  3. changed the title [-]Enforcing of Patch Version might not be desired[/-] [+]Using shorter versions ( v1.5 ) will add a 0 patch when not desired[/+] on Mar 19, 2022
  4. miniscruff commented on Mar 19, 2022

    @miniscruff
    Owner

    One further point is that this will also allow specifying only major versions, if for whatever reason you wanted to. Such as changie batch v2. It seems like semver requires a minor and patch to exist but I would argue that v1 is just short for v1.0.0 and that v2.5 is short for v2.5.0 anyway. So I will allow it.

  5. bephinix commented on Mar 20, 2022

    @bephinix
    ContributorAuthor

    @miniscruff Thanks, for the fast patch. 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions