-
-
Notifications
You must be signed in to change notification settings - Fork 50
feat: add support to filter commit msgs by prefixes #45
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
Conversation
Some teams do not expect a version bump when a README gets updated with a docs prefix commit or a style change. To allow that flexibility, this commit introduces a commit-prefix flag that can take multiple values to filter out commit logs before being used to calculate the next semver
@caarlos0 Please see if you want to merge this :) |
@caarlos0 Checking in again. Would you be interested to merge this ? |
sorry, totally missed this |
thanks for the pr! |
@@ -40,3 +41,29 @@ func FindNext(current *semver.Version, forcePatchIncrement bool, log string) sem | |||
|
|||
return *current | |||
} | |||
|
|||
func FilterCommits(log string, prefixes []string) string { | |||
lines := strings.Split(log, "\n") |
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.
this doesn't really work, as commit msgs are multi-lined 🤔
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.
will revert this for now
Svu searches across the entire git log for commits which is inconvenient when there are multiple packages in one repo (a monorepo). There are a few ways we could handle this: * We could filter commit messages by a specific prefix, which requires users to use the prefix in their commits and as commits are multiple lines[1] is more complicated to implement than first seems * We could add the files to the commit log and search through that, but again is more complicated than it seems * Use git logs ability to filter by directory (this commit) * some other idea I've not thought of [1] caarlos0#45
Svu searches across the entire git log for commits which is inconvenient when there are multiple packages in one repo (a monorepo). There are a few ways we could handle this: * We could filter commit messages by a specific prefix, which requires users to use the prefix in their commits and as commits are multiple lines[1] is more complicated to implement than first seems * We could add the files to the commit log and search through that, but again is more complicated than it seems * Use git logs ability to filter by directory (this commit) * some other idea I've not thought of [1] caarlos0#45
Svu searches across the entire git log for commits which is inconvenient when there are multiple packages in one repo (a monorepo). There are a few ways we could handle this: * We could filter commit messages by a specific prefix, which requires users to use the prefix in their commits and as commits are multiple lines[1] is more complicated to implement than first seems * We could add the files to the commit log and search through that, but again is more complicated than it seems * Use git logs ability to filter by directory (this commit) * some other idea I've not thought of [1] caarlos0#45
Svu searches across the entire git log for commits which is inconvenient when there are multiple packages in one repo (a monorepo). There are a few ways we could handle this: * We could filter commit messages by a specific prefix, which requires users to use the prefix in their commits and as commits are multiple lines[1] is more complicated to implement than first seems * We could add the files to the commit log and search through that, but again is more complicated than it seems * Use git logs ability to filter by directory (this commit) * some other idea I've not thought of [1] #45
Some teams do not expect a version bump when a README gets updated with a docs prefix commit or a style change.
To allow that flexibility, this commit introduces a commit-prefix flag that can take multiple values to filter out commit logs before being used to calculate the next semver