Resolve "Allow API method /projects/:id/repository/commits to work over all commits"
What does this MR do?
Before commits API endpoint would only work for a specific ref (default would be the default_branch
of that project).
This adds the possibility to return every rev
by adding a new attribute to the endpoint called --all
To do it we need to git log
logic's the option to return every rev
as seen on https://git-scm.com/docs/git-rev-list#git-rev-list---all which applies cleanly to git log
as seen in https://www.git-scm.com/docs/git-log#_description
Workflow
API::Commits
-> Repository#commits
-> Git::Commits#where
-> Git::Repository#log
-> (if not using Gitaly) Git::Repository#raw_log
-> Git::Repository#log_by_shell
Conclusions
log_by_shell
is where the command git log
gets shells out to Git with all the arguments, so this is where we need to add the option --all
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered -
End-to-end tests pass ( package-qa
manual pipeline job)
What are the relevant issue numbers?
Closes #42434 (closed)