Skip to content

Unable to get page count info when calling commit.diff() #1231

Closed

Description

@hungluong5791

Description of the problem, including code/CLI snippet

Calling commit.diff() to get diff information for a commit only return per_page items or 20 by default. It seems commit.diff() does not take either all or as_list and only pagination works, but we don't know how many page there are except by manually checking the returned list size.

Expected Behavior

Using commit.diff() should be able to give us all the diffs in a commit without having to manually checking the returned page size

Actual Behavior

As described

Specifications

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

Activity

  1. max-wittig commented on Nov 20, 2020

    @max-wittig
    Member

    Sounds like an upstream issue to me, as python-gitlab is just sending these query parameter. Have you tried it with curl as well?

  2. hungluong5791 commented on Nov 20, 2020

    @hungluong5791
    Author

    @max-wittig Per this reference I don't think they have an all parameter for the diff endpoint. However since python-gitlab have its own generator mechanism (as_list=False) for paging convenience, I was thinking of adding it to the Manager for commit diffs as well?

    I guess this is more like a feature request rather than a bug.

  3. added 2 commits that reference this issue on Jan 8, 2022
    8b4f500
    497e860
  4. locked as resolved and limited conversation to collaborators on Jan 9, 2023
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions