> ## 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.

# What a change request changes

> Its commits and changed files, with each text file's patch, compared to where its branch left the branch it's for, or for a merged request, to what it merged onto. `up_to_date` says whether it can merge as it is.



## OpenAPI

````yaml /api-reference/openapi.json get /projects/{owner}/{slug}/change-requests/{number}/diff
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}/change-requests/{number}/diff:
    get:
      tags:
        - Change requests
      summary: What a change request changes
      description: >-
        Its commits and changed files, with each text file's patch, compared to
        where its branch left the branch it's for, or for a merged request, to
        what it merged onto. `up_to_date` says whether it can merge as it is.
      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: integer
            minimum: 1
            example: 12
          required: true
          name: number
          in: path
      responses:
        '200':
          description: What it changes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChangeRequestDiff'
        '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'
        '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: The repo couldn't be read
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Change requests aren't set up here, or the repo is waking up
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ChangeRequestDiff:
      type: object
      properties:
        base:
          type:
            - string
            - 'null'
          description: >-
            The commit its changes are compared to: where its branch left the
            branch it's for, or for a merged request, what it merged onto. Null
            when there's no shared history to compare, or the branch is gone.
        head:
          type: string
          description: Its latest commit.
        branch_head:
          type:
            - string
            - 'null'
          description: >-
            The latest commit of the branch it's for. Null for a merged request,
            or when the branch is gone.
        up_to_date:
          type:
            - boolean
            - 'null'
          description: >-
            Whether it can merge as it is: the branch it's for hasn't moved on
            since its branch left. Null for a request that isn't open.
        commit_count:
          type: integer
          description: 'How many commits it brings: when `truncated`, at least this many.'
        commits:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              subject:
                type: string
                description: Its message's first line
              author:
                type: string
              committed_at:
                type: string
                format: date-time
            required:
              - id
              - subject
              - author
              - committed_at
          description: 'Its commits, newest first: the first 250.'
        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
        truncated:
          type: boolean
          description: >-
            Whether anything was left out: patches stop at 300 files or 2 MiB,
            the list of files at 3,000, and commits near 800. A change too big
            to read at all has no files.
      required:
        - base
        - head
        - branch_head
        - up_to_date
        - commit_count
        - commits
        - 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

````

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