Skip to content

Allow filtering commits by path parameter #2688

Description

@vongrad

Description of the problem, including code/CLI snippet

The documentation for GitLab API states that it is possible to filter all commits that affect a specific file by specifying path parameter:
https://docs.gitlab.com/ee/api/commits.html (List repository commits section)

This is however not possible when doing:
commits = project.commits.list(path='test.py')
since the path parameter is reserved to override url path in mixins.py's def list(self, **kwargs: Any):

# Allow to overwrite the path, handy for custom listings
path = data.pop("path", self.path)

Expected Behavior

It should be possible to filter commits by path parameter

Actual Behavior

The path parameter is popped from query params and used in the url path instead

Specifications

  • python-gitlab version: 3.14.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions