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

feat(options): add mergeCommitFilter option to cli #595

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mediavrog
Copy link

@mediavrog mediavrog commented Feb 14, 2020

Based off the discussion on #375 and other issues, I started an implementation to add a new option to either include, exclude or only show merge commits when generating the changelog.

It still needs tests and I need to test the code myself properly, but so far I could already verify that the changelog is complete when just dropping the merges:false from the gitRawCommitOpts in merge-config.js.

For now, I think the option merge-commit-filter should default to exclude, as this is the current behavior and would not break existing usage.

I will try to clean things up later when I have more time, but please also feel free to contribute.

@coveralls
Copy link

coveralls commented Feb 14, 2020

Coverage Status

Coverage decreased (-0.05%) to 92.665% when pulling 6c3b0ce on mediavrog:include-merge-commits into ab58e7a on conventional-changelog:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 92.585% when pulling e733449 on mediavrog:include-merge-commits into 49dcd6e on conventional-changelog:master.

Copy link
Member

@tommywo tommywo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mediavrog and thank you for contributing. 🎉
I've added some notes on the code.

packages/conventional-changelog-core/lib/merge-config.js Outdated Show resolved Hide resolved
@mediavrog mediavrog force-pushed the include-merge-commits branch 2 times, most recently from 5d63e42 to ac1f189 Compare February 18, 2020 06:45
@mediavrog mediavrog changed the title feat(options): add mergeCommitFilter option feat(options): add mergeCommitFilter option to cli Feb 18, 2020
@mediavrog
Copy link
Author

verified working using the below command on a project using git-flow (and thus tags on merge commits)

npm i -g ./packages/standard-changelog
standard-changelog --first-release -m include
standard-changelog --first-release -m only-merges
standard-changelog --first-release -m exclude
standard-changelog --first-release -m abc // default to exclude

@mediavrog
Copy link
Author

@tommywo I need some help with the tests. If you could have a look at https://github.com/conventional-changelog/conventional-changelog/pull/595/files#diff-177d48f386b5a5dce18e8dd697f40b1dR304 and point me to what I am doing wrong.

Also, I'd ideally want to make the tests for ----merge-commit-filter independent from --first-release

@bcoe
Copy link
Member

bcoe commented Nov 2, 2020

@mediavrog I apologize for the slow momentum on this project recently. Could I bother you to resolve the conflicts on this branch?

@RangerRick
Copy link

I tried doing a quick merge to see if I could get this working but the tests fail for me and I don't understand the internals enough to fix it. If someone has more time than I to look into it, my attempts at cleanup are here

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

6 participants