question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: chore commits increment patch version, but they shouldn't

See original GitHub issue

Unless I’m missing something this is a pretty severe bug. Version patches up for chore commits, maybe others.

Click here for minimal example repo here

git log

Environment

"commitizen": "2.9.6",
"cz-conventional-changelog": "2.0.0",
"standard-version": "4.0.0"

Node 7

Repro

  1. Add changes
  2. npm run commit
  3. set type as a chore, no breaking changes
  4. npm run release
  5. see the version increment when it shouldn’t

Example actions

# commit some changes using commitizen
$ npm run commit
Line 1 will be cropped at 100 characters. All other lines will be wrapped after 100 characters.

? Select the type of change that you're committing: chore   # <---- a chore
? Denote the scope of this change ($location, $browser, $compile, etc.):
 dev
? Write a short, imperative tense description of the change:
 add npm run commit command
? Provide a longer description of the change:
 so people can test if they dont have git cz global
? List any breaking changes:

? List any issues closed by this change:

[master 79ab9f4] chore(dev): add npm run commit command
 1 file changed, 2 insertions(+), 1 deletion(-)

$ gst
On branch master
nothing to commit, working tree clean

# run standard
$ npm run release

> cz-meridian@0.0.0 release /Users/fraleyj/experiments/standard-v-demo
> standard-version

✔ bumping version in package.json from 0.0.0 to 0.0.1 # <--- bad
✔ outputting changes to CHANGELOG.md
✔ committing package.json and CHANGELOG.md
✔ tagging release 0.0.1
ℹ Run `git push --follow-tags origin master; npm publish` to publish

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
Tapppicommented, Mar 31, 2017

With semantic release, you are forced to have a very strict commit guideline. With standard version you choose when you release. If you’re change doesn’t affect any code etc., it is advised as a chore/docs etc. But you might still want to release it. Standard-version allows that, but it isn’t possible with semantic release. It is simply the tradeoffs of similar but different workflows. I think that this is a strength, not a weakness, of standard-version.

9reactions
joefraleycommented, Mar 22, 2017

@Tapppi I expect the version tool to be a no-op if none of the current commits are a fix/feat/breaking change. Like commit 1000 chores/docs/perfs, run standard, see nothing change.

Read more comments on GitHub >

github_iconTop Results From Across the Web

conventional commit messaging - Conventional Commits
A specification for adding human and machine readable meaning to commit messages.
Read more >
Enhance your git log with conventional commits
I think we shouldn't confound git commit with ctrl + s . A git log should ... fix: Fix a bug (equivalent to...
Read more >
Semantic Versioning - The Blue Book
Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards compatible bug fixes are introduced. A bug fix is...
Read more >
Version Incrementing - GitVersion
Semantic Versioning is all about releases, not commits or builds. This means that the version only increases after you release, this directly conflicts...
Read more >
How do you avoid updating the version number on every ...
Commits shouldn't be broad, and only fix/change one or two things. Got 3 unrelated bug fixes? Give each their own commit. Updates should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found