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(raw-commits): allow hidding by subject pattern #1063
feat(raw-commits): allow hidding by subject pattern #1063
Conversation
please @dangreen when you get a chance 👀 |
@roggervalf Hi. I think "types" is not right place for filtering by subject. We can add new option "ignore" to git-raw-commits to ignore commits by regex (here). And pass it option from preset
WDYT? |
Thank you @dangreen, sounds good to me, I think I could address it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore commit by pattern is a rare case, so I don't want to add new dependency for it. Regex should fit you needs
packages/git-raw-commits/index.js
Outdated
@@ -65,7 +65,9 @@ function gitRawCommits (rawGitOpts, rawExecOpts) { | |||
transform (chunk, enc, cb) { | |||
isError = false | |||
setImmediate(() => { | |||
readable.push(chunk) | |||
if ( !(gitOpts?.ignore && isMatch(chunk.toString(), gitOpts?.ignore))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use regex instead of glob
const ignoreRegex = typeof gitOpts.ignore === 'string'
? new RegExp(gitOpts.ignore)
: gitOpts.ignore
const shouldNotIgnore = ignoreRegex
? chunk => !ignoreRegex.test(chunk.toString())
: () => true
...
if (shouldNotIgnore(chunk)) {
readable.push(chunk)
}
Thank you @dangreen, it sound good to me |
Add a way to hide commits with specific pattern from the release notes. This is useful in order to avoid commits with specific messages that we don't want to include in release notes