[go: up one dir, main page]

Skip to content

The Commits API does not return git trailers for individual commits

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Steps to reproduce

  1. Create a commit for a repository using --trailer
  2. For example: git commit -m "initial commit" --trailer "signed-off-by: testEmail@example.com"
  3. 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"
      ]
    },
   ....
]
  1. Note that trailers and extended_trailers are populated.
  2. Using the id for the commit, attempt to 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": {

  },
...
}
  1. Observe that trailers and extended_trailers are not set

Example Project

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

Output of checks

This bug happens on GitLab.com

Possible fixes

Edited by 🤖 GitLab Bot 🤖