Skip to content
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

fix(commit): don't try to process or to add changelog if it's skipped #318

Merged

Conversation

georgiee
Copy link
Contributor

If you skip changelog generation standard-version fails to process the remaining checkpoints. This PR provides a fix.

Fixes

  • Prevent CHANGELOG.md or any given infile from being added to git when skipped.
  • Prevent CHANGELOG.md or any given infile from being added to the output when skipped.

Problem Description

Given this config:

"standard-version": {
    "skip": {
      "changelog": false,
      "tag": true
    }
  },

Before

✔ bumping version in package.json from 1.0.0 to 1.1.0
✔ committing package.json and CHANGELOG.md
fatal: pathspec 'CHANGELOG.md' did not match any files

Command failed: git add package.json CHANGELOG.md
fatal: pathspec 'CHANGELOG.md' did not match any files

After

✔ bumping version in package.json from 1.0.0 to 1.1.0
✔ committing package.json

Could not find any tests so I made the changes and tried it locally with the desired result.

Hope this works, thanks for this great tool.
Regards

@georgiee
Copy link
Contributor Author

Of course there are tests and of course I break them including some wrong formats. I'm going to provide a test and fix the code style issues.

@georgiee georgiee force-pushed the fix-changelog-error-and-output branch from 8a414ca to 4cb7c07 Compare March 28, 2019 14:15
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 4cb7c07 on georgiee:fix-changelog-error-and-output into aad6a61 on conventional-changelog:master.

@coveralls
Copy link

coveralls commented Mar 28, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling bd17383 on georgiee:fix-changelog-error-and-output into a5ac845 on conventional-changelog:master.

@georgiee
Copy link
Contributor Author

I run into this problem while I set up versioning where I didn't need an actual changelog in the beginning. The config gives me the possibility to skip the changelog processing — which implies not to create a changelog when there is none yet. People would be really surprised to find a checked in and empty changelog after their decision to skip it for whatever reasons.

@bcoe
Copy link
Member

bcoe commented May 5, 2019

@georgiee seems reasonable to me, mind rebasing? sorry for the slow feedback.

@georgiee georgiee force-pushed the fix-changelog-error-and-output branch 2 times, most recently from 567b70a to 8d38b9c Compare May 10, 2019 11:14
@georgiee georgiee force-pushed the fix-changelog-error-and-output branch from 8d38b9c to bd17383 Compare May 10, 2019 11:18
@georgiee
Copy link
Contributor Author

Done 👌 All tests are running, my new test works too and the CLI behaves exactly as expected now.

@bcoe bcoe merged commit 3e4fdec into conventional-changelog:master May 10, 2019
@igorsechyn
Copy link

Any chance this change can be released? This currently forces us to have an empty CHANGELOG file.

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

Successfully merging this pull request may close these issues.

None yet

4 participants