---
title: "GET /api/repos/{namespace}/{repository}/commits/{oid}"
method: GET
path: "/api/repos/{namespace}/{repository}/commits/{oid}"
tags: ["repository"]
---

# GET /api/repos/{namespace}/{repository}/commits/{oid}

`GET /api/repos/{namespace}/{repository}/commits/{oid}`

## Path parameters

- `namespace` string, required
- `repository` string, required
- `oid` string, required

## Response `200`

Commit detail with structured diff

- CommitDetailResponse
  - `branch` string, nullable — Short branch name that contains this commit, if any
  - `commit` CommitMeta, required
    - `author` SignatureInfo, required
      - `email` string, required — Email address
      - `name` string, required — Display name
      - `timestamp` integer, required — Unix timestamp
      - `uid` string, uuid, nullable — GitArena user ID, if the email matches a registered user
    - `committer` SignatureInfo, required
      - `email` string, required — Email address
      - `name` string, required — Display name
      - `timestamp` integer, required — Unix timestamp
      - `uid` string, uuid, nullable — GitArena user ID, if the email matches a registered user
    - `description` string, nullable — Remainder of the commit message after the first blank line, if any
    - `message` string, required — First line of the commit message
    - `oid` string, required — Full SHA-1 hex
    - `parents` string[], required — Parent commit OIDs (full SHA-1 hex)
    - `shortOid` string, required — Abbreviated SHA-1 hex (7 chars)
  - `files` DiffFile[], required
    - `binary` boolean, required — Whether the file is binary (hunks will be empty)
    - `hunks` DiffHunk[], required — Diff hunks (empty for binary or too-large files)
      - `header` string, required — Hunk header line (e.g. "@@ -12,7 +12,9 @@ impl Cloner {")
      - `lines` DiffLineEntry[], required — Lines in this hunk
        - `content` string, required — Line content without the leading +/-/space character
        - `kind` 'context' | 'addition' | 'deletion', required
        - `newLineNumber` integer, nullable — Line number in the new file (null for deletions)
        - `oldLineNumber` integer, nullable — Line number in the old file (null for additions)
      - `newLines` integer, required — Number of lines in the new file
      - `newStart` integer, required — Starting line number in the new file
      - `oldLines` integer, required — Number of lines in the old file
      - `oldStart` integer, required — Starting line number in the old file
    - `oldPath` string, nullable — Old path, only present for renames and copies
    - `path` string, required — New path of the file (or only path for non-renames)
    - `stats` FileStats, required
      - `deletions` integer, required — Lines deleted in this file
      - `insertions` integer, required — Lines added in this file
    - `status` 'added' | 'deleted' | 'modified' | 'renamed' | 'copied' | 'untracked', required
    - `tooLarge` boolean, required — Whether the file was truncated due to exceeding the line cap (hunks will be empty)
  - `stats` DiffStats, required
    - `deletions` integer, required — Total lines deleted
    - `filesChanged` integer, required — Number of files changed
    - `insertions` integer, required — Total lines added

## Other responses

- `400` — Invalid OID
- `404` — Repository or commit not found

---

[API](https://skmtc.dev/mari/apis/gitarena.md) · [All operations](https://skmtc.dev/mari/apis/gitarena/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mari/gitarena/revisions/b3640d5600df/schema)
