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

Regex preprocess commit messages #62

Closed
hypervtechnics opened this issue Feb 11, 2022 · 2 comments
Closed

Regex preprocess commit messages #62

hypervtechnics opened this issue Feb 11, 2022 · 2 comments
Assignees
Labels
feature/request New feature or request
Milestone

Comments

@hypervtechnics
Copy link

Is your feature request related to a problem? Please describe.
Our CI system prepends all changes which are merged by using the PR functionality (by policy everyone has to do so) with "Merged PR xxx: ". This does not comply with the conventional commit message format.

Describe the solution you'd like
Something like a commit message preprocessor which enables us to remove or select certain parts of the commit message/body to be used in the following processes.

Describe alternatives you've considered
Removing that prefix, which is unfortunately not possible.

@hypervtechnics hypervtechnics added the feature/request New feature or request label Feb 11, 2022
@hypervtechnics hypervtechnics changed the title Trim commit messages in case of merge commits Regex preprocess commit messages Feb 11, 2022
@orhun orhun added this to the 0.7.0 milestone Mar 13, 2022
@orhun
Copy link
Owner

orhun commented Apr 6, 2022

This is implemented in 64317f2. See commit_preprocessors.

For your specific example, now you can do something like this to remove the prefix:

[git]
commit_preprocessors = [
    { pattern = 'Merged PR #[0-9]: (.*)', replace = "$1"}
]

@hypervtechnics
Copy link
Author

This is totally great! Thank you for it 😄

@orhun orhun closed this as completed Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants