Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

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

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

Closed
danhlee329 opened this issue Oct 21, 2020 · 2 comments · Fixed by #307
Closed

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

danhlee329 opened this issue Oct 21, 2020 · 2 comments · Fixed by #307

Comments

@danhlee329
Copy link

danhlee329 commented Oct 21, 2020

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
@danhlee329 danhlee329 changed the title Prevent Prerelease 'Bump' From Release Version Prevent Prerelease 'Bump' From Release Version With No Increment Detected Oct 21, 2020
@Lee-W
Copy link
Member

Lee-W commented Oct 23, 2020

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. 🙂

@woile
Copy link
Member

woile commented Oct 27, 2020

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

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

Successfully merging a pull request may close this issue.

3 participants