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

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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions