Skip to content

Prevent Prerelease 'Bump' From Release Version With No Increment Detected #281

Description

@danhlee329

Description

When there is already a release, shouldn't we be prevented from creating a prerelease version from the release version? Found this to be odd as this goes against the proper flow of change denoted via semantic versioning (https://semver.org/#spec-item-3). Perhaps this should only be allowed if increment detected is not None.

Steps to reproduce

# Commits prior to bumps have been done, but are omitted here for the
# sake of displaying bump behavior
➜ cz bump -pr alpha
bump: version 0.1.0 → 0.1.1a0
tag to create: 0.1.1a0
increment detected: PATCH

Done!

# Tag '0.1.1' Created
➜ cz bump
bump: version 0.1.1a0 → 0.1.1
tag to create: 0.1.1
increment detected: None

Done!

# Release to prerelease 'bump' here
➜ cz bump -pr beta 
bump: version 0.1.1 → 0.1.1b0
tag to create: 0.1.1b0
increment detected: None

Done!

➜ cz bump -pr beta 
bump: version 0.1.1b0 → 0.1.1b1
tag to create: 0.1.1b1
increment detected: None

Done!

# Tag '0.1.1' Already Exists
➜ cz bump
bump: version 0.1.1b1 → 0.1.1
tag to create: 0.1.1
increment detected: None

fatal: tag '0.1.1' already exists

Environment

  • commitizen version: 2.4.1
  • python version: Python 2.7.16, Python3 3.9.0
  • operating system: MacOS Catalina, 10.15.6

Activity

  1. changed the title [-]Prevent Prerelease 'Bump' From Release Version[/-] [+]Prevent Prerelease 'Bump' From Release Version With No Increment Detected[/+] on Oct 21, 2020
  2. Lee-W commented on Oct 23, 2020

    @Lee-W
    Member

    Hi @danhlee329 , thanks for reporting the bug! I think it relates to the code near here. Unfortunately, we're both at this moment and might not have time to fix it immdiately. Feel free to send us a PR. 🙂

  3. woile commented on Oct 27, 2020

    @woile
    Member

    I'll try to submit a patch for this during this week

  4. added 2 commits that reference this issue on Nov 21, 2020
    fda3017
    7bafa42
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions