Skip to content

Add --include-messages option to filter commits by subject regex#76

Open
autumn-n wants to merge 1 commit into
linear:mainfrom
autumn-n:feat/include-messages-filter
Open

Add --include-messages option to filter commits by subject regex#76
autumn-n wants to merge 1 commit into
linear:mainfrom
autumn-n:feat/include-messages-filter

Conversation

@autumn-n
Copy link
Copy Markdown

Adds --include-messages, a regex filter on the commit subject. Used alongside --include-paths, it lets you drop commits that shouldn't show up in a release — bot pushes, direct commits without an issue link, anything that doesn't fit your team's conventions — without rewriting history.

The regex matches the subject only (everything before the first \n) so squash dumps and trailers in the body can't accidentally match. The pattern is stored as a string and compiled once inside scanCommits, mirroring how --include-paths is stored as a string array and turned into pathspec arguments at the point of use. Both filters compose: a commit must pass both to be scanned.

Examples

# Only commits that reference a Linear issue identifier
linear-release sync --include-messages="[A-Z]{2,}-[0-9]+"

# Conventional Commits — drop chore/docs/test/ci/build noise
linear-release sync --include-messages="^(feat|fix|perf):"

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant