---
title: "Get the diff and log message for a commit"
method: GET
path: "/version/show"
tags: ["versioning"]
---

# Get the diff and log message for a commit

`GET /version/show`

Get the diff and log message for a commit. Default is the latest commit (HEAD).

## Query parameters

- `commit` string
- `filename` string
- `diffLineLimit` integer

## Response `200`

The requested GitShowResult object in a single-item list.

- CountedGitShowResult
  - `count` integer, required — number of items present in the items array
  - `items` GitShowResult[], required — List of items in this response.
    - `commitMessage` string, required — Full commit message of the specified commit.
    - `diffJson` object[], required
      - `addedLines` integer, required — Number of lines added in this file.
      - `blocks` object[], required — Array of diff blocks (hunks) showing changed line ranges in this file.
        - `header` string, required — Unified diff hunk header.
        - `lines` union[], required — Array of lines in a Git diff hunk.
          - union
            - DiffLineDelete — Deleted line in a Git diff hunk.
              - …
            - DiffLineInsert — Inserted line in a Git diff hunk.
              - …
            - DiffLineContext — Unchanged context line in a Git diff hunk.
              - …
        - `newStartLine` integer, required — Starting line number in the new file for this hunk.
        - `oldStartLine` integer, required — Starting line number in the original file for this hunk.
        - `oldStartLine2` integer — Starting line number in the original file for the second parent, present in combined diffs.
      - `changedPercentage` number — Percentage of lines in the file that changed.
      - `checksumAfter` string — Checksum of the new file.
      - `checksumBefore` union — Checksum of the original file. May be an array for combined diffs.
        - string
        - string[]
      - `deletedFileMode` string — File mode of the deleted file, present when the file was deleted.
      - `deletedLines` integer, required — Number of lines deleted in this file.
      - `isBinary` boolean — If <code>true</code>, this file is a binary file and the diff content is not shown. Otherwise, <code>false</code>.
      - `isCombined` boolean, required — If <code>true</code>, this is a combined diff (merge commit). Otherwise, <code>false</code>.
      - `isCopy` boolean — If <code>true</code>, this file was copied from another path. Otherwise, <code>false</code>.
      - `isDeleted` boolean — If <code>true</code>, this file was deleted in the commit. Otherwise, <code>false</code>.
      - `isGitDiff` boolean, required — If <code>true</code>, this diff was generated by Git. Otherwise, <code>false</code>.
      - `isNew` boolean — If <code>true</code>, this file was added in the commit. Otherwise, <code>false</code>.
      - `isRename` boolean — If <code>true</code>, this file was renamed. Otherwise, <code>false</code>.
      - `isTooBig` boolean — If <code>true</code>, the diff was truncated because it exceeded the line limit. Otherwise, <code>false</code>.
      - `language` string, required — Programming language or file format detected for syntax highlighting.
      - `mode` string — Combined file mode when both old and new modes are the same.
      - `newFileMode` string — File mode of the new file, present when the file was added.
      - `newMode` string — File mode of the new file.
      - `newName` string, required — New file path after the change.
      - `oldMode` union — File mode of the original file. May be an array for combined diffs.
        - string
        - string[]
      - `oldName` string, required — Original file path before the change.
      - `unchangedPercentage` number — Percentage of lines in the file that are unchanged.

## Other responses

- `401` — Authentication failed (missing or invalid credentials or Bearer token).
- `500` — Unexpected server error.

---

[API](https://skmtc.dev/criblio/apis/cribl-api-reference.md) · [All operations](https://skmtc.dev/criblio/apis/cribl-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/criblio/cribl-api-reference/revisions/56cb25079271/schema)
