To print the max of 100 results per “page”, use &per_page=100.
To fetch more than one hundred, you’ll need to use per_page=100 in combination with &page=#, incrementing page number by 1 for each set of 100 results.
@gitlab-greg could you please tell what is the parameter all used for though, when I used it with path or ref_name it gives me back an empty array but if I remove all=true it does show some results.
The path parameter is used to specify which file path you’d like to list commits for.
The ref_name is used to specifiy the “name of a repository branch, tag or revision range” you’d like to list commits of". Listing repository commits with ref_name provided will only return commits for the given branch. If ref_name is not provided, you’ll see commits for the default branch by default.
The all parameter is used to retrieve every commit from the repository. all used in combination with path will list all commits to that file across branches, tags and revision ranges, and all used without specifying a ref_name will list all commits to the repository.
Gitlab documentation is not so detailed as compared to what you have explained.
I also thought path with all should give me all commits. But strangely for my usecase path gives me the latest commits, path with all as true does gives me 2-3 or 0 commits and same is with path with all as true and ref_name.
Thats why had raised this topic, if you can guide me
I have similar scenario to find out the commit authors for the last 1 year on the default branch - more specifically for python files(only files ending with .py) Is there any ways for this?
I am able to get the details from a git command for this usage. But cloning a large set of repos and iterating is not the ideal way.
I found another api which gives me all files from a commit Commits API | GitLab . I thought of iterating through all diff files and getting the author name only if he/she contributed to .py file.
But this process seems to be expensive when compared to git cloning. Any thoughts on this?