> ## Documentation Index
> Fetch the complete documentation index at: https://docs.patch.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# One commit and what it changes

> At a branch, tag or commit: its message, parents, author and committer, and its files compared to its first parent, with each text file's patch in `git diff`'s hunks. In a repo's first commit, every file is added. A file with no patch says why in `no_patch`, and `truncated` says when anything was left out. 404 `ref_not_found`.



## OpenAPI

````yaml /api-reference/openapi.json get /projects/{owner}/{slug}/repo/commit
openapi: 3.1.0
info:
  title: Patch API
  version: 1.0.0
  description: >-
    The public API behind patch.gg, the desktop app and pch. Changes within v1
    are additive only. Errors are { error: { code, message, details } }; branch
    on code.
servers:
  - url: https://patch.gg/api/v1
security: []
paths:
  /projects/{owner}/{slug}/repo/commit:
    get:
      tags:
        - Repos
      summary: One commit and what it changes
      description: >-
        At a branch, tag or commit: its message, parents, author and committer,
        and its files compared to its first parent, with each text file's patch
        in `git diff`'s hunks. In a repo's first commit, every file is added. A
        file with no patch says why in `no_patch`, and `truncated` says when
        anything was left out. 404 `ref_not_found`.
      parameters:
        - schema:
            type: string
            example: patch
          required: true
          name: owner
          in: path
        - schema:
            type: string
            example: demo-mod
          required: true
          name: slug
          in: path
        - schema:
            type: string
            pattern: ^\S{1,255}$
            description: >-
              A branch, a tag or a full commit hash: the default branch unless
              you say. A branch comes before a tag of the same name, and
              `refs/tags/v1` says which.
            example: main
          required: false
          description: >-
            A branch, a tag or a full commit hash: the default branch unless you
            say. A branch comes before a tag of the same name, and
            `refs/tags/v1` says which.
          name: ref
          in: query
      responses:
        '200':
          description: The commit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepoCommit'
        '308':
          description: Renamed; follow the Location header
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Not signed in
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: '`on_github`: its home is GitHub, which has its files'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Too many requests: wait as long as `Retry-After` says
            (`retry_after_s` in `details`), then retry
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: It couldn't be read
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Reading repos isn't set up here, or the repo is waking up
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    RepoCommit:
      allOf:
        - $ref: '#/components/schemas/RepoLogCommit'
        - type: object
          properties:
            message:
              type: string
              description: Its message, its first 64 KiB at most.
            ref:
              type: string
              description: >-
                The branch, tag or full commit hash it was asked for: the
                default branch unless given.
            base:
              type:
                - string
                - 'null'
              description: >-
                The commit `files` compares it to: its first parent. Null for a
                first commit.
            files:
              type: array
              items:
                type: object
                properties:
                  path:
                    type: string
                  old_path:
                    type:
                      - string
                      - 'null'
                    description: Where it was, when it moved.
                  status:
                    type: string
                    enum:
                      - added
                      - modified
                      - deleted
                      - renamed
                  type:
                    type: string
                    enum:
                      - blob
                      - exec
                      - symlink
                      - gitlink
                  old_blob:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Its git object before, shortened. For a submodule, the
                      whole commit.
                  blob:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Its git object after, shortened. For a submodule, the
                      whole commit.
                  additions:
                    type: integer
                    description: Lines added, when it has a patch.
                  deletions:
                    type: integer
                    description: Lines removed, when it has a patch.
                  patch:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Its changed lines, in the hunks `git diff` shows, with 3
                      lines around them. Bytes that aren't UTF-8 show as U+FFFD,
                      so a patch with any won't apply.
                  no_patch:
                    type:
                      - string
                      - 'null'
                    enum:
                      - binary
                      - big_file
                      - too_big
                      - too_much
                      - null
                    description: >-
                      Why a file whose contents changed has no patch. binary: it
                      isn't text. big_file: it's in Git LFS. too_big: its patch
                      is over 1 MiB, or couldn't be read. too_much: the diff is
                      too long to show it.
                  big_file:
                    type:
                      - object
                      - 'null'
                    properties:
                      old:
                        type:
                          - object
                          - 'null'
                        properties:
                          sha256:
                            type: string
                          size:
                            type: integer
                        required:
                          - sha256
                          - size
                      new:
                        type:
                          - object
                          - 'null'
                        properties:
                          sha256:
                            type: string
                          size:
                            type: integer
                        required:
                          - sha256
                          - size
                    required:
                      - old
                      - new
                    description: The Git LFS files it points at, before and after.
                required:
                  - path
                  - old_path
                  - status
                  - type
                  - old_blob
                  - blob
                  - additions
                  - deletions
                  - patch
                  - no_patch
                  - big_file
              description: What it changes. For a first commit, every file is added.
            truncated:
              type: boolean
              description: >-
                Whether anything was left out: patches stop at 300 files or 2
                MiB, and the list at 3,000 files.
          required:
            - ref
            - base
            - files
            - truncated
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: version_exists
            message:
              type: string
            details: {}
          required:
            - code
            - message
      required:
        - error
    RepoLogCommit:
      type: object
      properties:
        hash:
          type: string
        message:
          type: string
          description: >-
            Its subject, the message's first paragraph on one line: 4,000
            characters at most.
        parents:
          type: array
          items:
            type: string
          description: Empty for a repo's first commit.
        author:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
          required:
            - name
            - email
        committer:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
          required:
            - name
            - email
        authored_at:
          type: string
          format: date-time
        committed_at:
          type: string
          format: date-time
      required:
        - hash
        - message
        - parents
        - author
        - committer
        - authored_at
        - committed_at

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.