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.

conventional commits/changelog adds all previous commits to release

See original GitHub issue

Current Behavior

With a lerna setup with version: independent and conventionalCommits: true for the publish command in lerna.json: when publishing a new release with lerna publish lerna takes all previous commits into account and adds all commits again into CHANGELOG.md for this release and also raises the version respecting all previous commits.

Expected Behavior

After publishing a release with lerna publish only commits are respected which came after the previous release.

Steps to Reproduce

  1. Add a feature commit feat: add a new feature
  2. lerna publish // will raise minor version 1.0.0 -> 1.1.0
  3. Add a fix commit fix: fix a bug
  4. lerna publish // will raise minor version again 1.1.0 -> 1.2.0 but should only raise patch to 1.1.1

Also in the CHANGELOG.md for the second release both commits will be listed but only the latest one should be listed.

See this demo repo: https://github.com/rumtraubenuss/monorepo/blob/master/packages/foo/CHANGELOG.md

Environment

{
  "lerna": "3.0.0-rc.0",
  "packages": ["ui-lib/*"],
  "version": "independent",
  "npmClient": "yarn",
  "useWorkspaces": true,
  "commands": {
    "publish": {
      "allowBranch": "master",
      "conventionalCommits": true
    }
  }
}
Executable Version
lerna --version 3.0.0-rc.0 and 2.11.0
npm --version 5.6.0
yarn --version 1.7.0
node --version 8.11.1
OS Version
macOS 10.13.6

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
rumtraubenusscommented, Aug 3, 2018

The issue is triggered by a format setting in my global git config ~/.gitconfig:

[format]
	pretty = %Cblue%h%Creset %Cgreen[%cr]%Creset (%an) %s

Removing this and everything works as expected.

@evocateur Do you think that this is still related to lerna itself or rather to a dependency package like conventional-changelog-core?

0reactions
lock[bot]commented, Dec 27, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

conventional commits/changelog adds all previous ... - GitHub
I compared to my local gitconfig and only thing that looks different are a few aliases but no core configs for format. The...
Read more >
How To Automatically Generate A Helpful Changelog From ...
Creating a changelog is a usual task if a new software version is going to be released. It contains all the changes which...
Read more >
Tooling for Conventional Commits
go-conventional-commits: A tool to parser your git commit messages into a change log message based on conventional commits specification.
Read more >
How to generate Changelog using Conventional Commits
In automatic standard-version , checking the commits made since the last release, will: do a version bump (MAJOR, MINOR, PATCH); create a git ......
Read more >
git - Why does my old commits re-appear every time I update ...
My script in package.json looks like this: "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r && git add CHANGELOG ...
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