The Commits API does not return git trailers for individual commits
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=558984) </details> <!--IssueSummary end--> <!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "type::bug" label: - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=type::bug and verify the issue you're about to submit isn't a duplicate. ---> ### Summary - The [Commits API](https://docs.gitlab.com/api/commits/#list-repository-commits) mentions support for [git trailers](https://git-scm.com/docs/git-interpret-trailers) - Trailers are returned for the ['List repository commits' endpoint](https://docs.gitlab.com/api/commits/#list-repository-commits) when `?trailers=true`, but they are not populated on the ['Get a single commit' endpoint](https://docs.gitlab.com/api/commits/#get-a-single-commit) (nor are they mentioned in the example output :sweat_smile: ) ### Steps to reproduce 1. Create a commit for a repository using `--trailer` 1. For example: `git commit -m "initial commit" --trailer "signed-off-by: testEmail@example.com"` 2. Request the commits for the repository with `?trailers=true` set. Example output: ``` { "id": "d4a783e28b755b8873618d1091f4aa41ddf392f6", "short_id": "d4a783e2", "created_at": "2025-08-04T10:32:00.000+09:30", "parent_ids": [ "cf66bfdef352225a96a4a1f3550a7cc4bd03f894" ], "title": "initial commit", "message": "initial commit\n\nsigned-off-by: testEmail@example.com\n", .... "committer_email": "redacted@labgit", "committed_date": "2025-08-04T10:32:00.000+09:30", "trailers": { "signed-off-by": "testEmail@example.com" }, "extended_trailers": { "signed-off-by": [ "testEmail@example.com" ] }, .... ] ``` 3. Note that `trailers` and `extended_trailers` are populated. 4. Using the `id` for the commit, attempt to get [a single commit](https://docs.gitlab.com/api/commits/#get-a-single-commit) (It does not appear to matter if `?trailers=true` is appended): ``` { "id": "d4a783e28b755b8873618d1091f4aa41ddf392f6", "short_id": "d4a783e2", "created_at": "2025-08-04T10:32:00.000+09:30", "parent_ids": [ "cf66bfdef352225a96a4a1f3550a7cc4bd03f894" ], "title": "initial commit", "message": "initial commit\n\nsigned-off-by: testEmail@example.com\n", .... "authored_date": "2025-08-04T10:32:00.000+09:30", "committer_name": "Tom McAtee", "committer_email": "redacted@labgit", "committed_date": "2025-08-04T10:32:00.000+09:30", "trailers": { }, "extended_trailers": { }, ... } ``` 5. Observe that `trailers` and `extended_trailers` are not set ### Example Project - **Internal-only:** I have reproduced this behaviour in [this sandbox project](https://gitlab.com/rrelax_ultimate_group/tickets/646311-git-trailers) ### What is the current *bug* behavior? - The `trailers`/`extended_trailers` attributes are not populated on single commit API responses, but are populated on responses from the 'List repository commits' endpoint ### What is the expected *correct* behavior? - The `trailers`/`extended_trailers` attributes should be populated (when existent) on responses from both endpoints ### Relevant logs and/or screenshots <!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise. --> ### Output of checks This bug happens on GitLab.com ### Possible fixes <!-- If you can, link to the line of code that might be responsible for the problem. --> <!-- If you don't have /label privileges, follow up with an issue comment of `@gitlab-bot label ~"type::bug"` -->
issue