Skip to content

Filtering commits by path before version bump #1347

Open
@dalbitresb12

Description

@dalbitresb12

Description

Introduce an option (either in the configuration file or as a CLI argument) to filter the commits that will be considered for the version bump calculation. This feature would allow users to specify a path prefix, ensuring that only commits affecting files within the specified path are taken into account.

This feature would provide a basic way to handle version bumping in monorepos by allowing users to focus on changes within specific subdirectories and could be used by users until full support for monorepos is added to commitizen (I saw other issues mentioning other types of features for monorepo support so this could be used together with those other features).

Possible Solution

I went ahead and tried implementing my suggestion in a fork so that I could start testing it with an internal application (I did search for contributing guidelines, but I didn't look in the docs/ folder, so I didn't see this line before implementing, sorry).

Basically the changes I made are:

I can make a PR for this feature and also make any other changes as needed so that this feature can see the light of day :)

Additional context

You can see the test I implemented for an example of the feature working.

Additional context

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dalbitresb12

        Issue actions

          Filtering commits by path before version bump · Issue #1347 · commitizen-tools/commitizen