-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
allow limiting commits to scoped ones #749
Comments
Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️ |
Hey! Thanks for the issue and sorry for the delayed response. Have you tried using the [git]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "(www)", scope = "Application" }
] Then you can use this scope for grouping in the template: git-cliff/examples/scoped.toml Lines 20 to 25 in 82cc09f
Check out the scoped template example to see if it works for you. Let me know if there is anything else that I can help :) |
Hi thanks for the reply. IIRC the issue is that it's not possible to produce an changelog for a specific scope. The issue lies on the side of the collection not on the side of generation. Let's assume one releases Project A which has scope "projecta". In addition to everything scoped it's also desired to show common changes in such changelog. The changelog for each project should be generated by different invocations (different changelogs) as it's attached to the release for such subproject. Normally this would be done with include or exclude paths, to only include files changed within a subfolder. But in my scenario changes to common files outside the directory should be shown as well. I'm suggesting filtering the commits similar to "include/exclude" on it's scope before passing it to the generating step. |
I see, I still feel like this might be somehow possible currently. For me to understand this better and kickstart the implementation, can you help me come up with a test fixture? I need a list of commits as follows, example configuration and expected output. e.g. git init
git commit --allow-empty -m "Initial commit"
touch scope-a/x
git add scope-a
git commit -m "feat(scope-a): add feature 1"
touch scope-a/y
git add scope-a
git commit -m "feat(scope-b): add feature 1"
git tag v0.1.0 and then I need the command e.g. |
Is there an existing issue or pull request for this?
Feature description
I have a monorepo where multiple projects are mixed into each other. This results in include and exclude path not being an option. I've tried to set a default scope for each commit parser and used scopes in each commit in order to assign it either to a specific project or an overlapping one. So for e.g. if a commit is affecting multiple projects we drop the scope within the commit title and fall back to a default scope called overlapping. The concrete problem is the lack of an option to filter commits by its scope in order to say for e.g. render the changelog for project A and every potentially overlapping commit.
Desired solution
It would be nice to have some kind of scope option to specify either in configuration or by cli argument to say: please filter every commit by the following scopes.
The desired call would look for e.g. like:
Alternatives considered
I'm not aware of a good alternative, but please let me know if something else comes to mind.
Additional context
I've tinkered with the repository and tried to implement a proof of concept in tobiaskohlbau@6133504. I would like to work on this if it gets accepted but most likely need some guidance as I've never done Rust before (Best practices etc.).
The text was updated successfully, but these errors were encountered: