Get Commit Diff

Returns a link for downloading the complete Git-compatible unified diff from the first parent to the requested commit.
Root commits are compared with the empty tree. The link always identifies this commit.
Downloads are limited to 300 changed files, 1 MiB total, 500 KiB per encoded file diff
and 20,000 lines.
Exceeding a limit returns HTTP 429 without a partial diff; retrying the same diff will not help.

Request

GET

https://api.sourcecraft.tech/repos/{org_slug}/{repo_slug}/commits/{commit_hash}/diff

Path parameters

Name

Description

commit_hash

Type: string

Full commit hash.

Example: ``

org_slug

Type: string

Example: ``

repo_slug

Type: string

Example: ``

Responses

200 OK

A successful response.

Body

application/json
{
  "link": "example",
  "expires_at": "2025-01-01T00:00:00Z"
}

Name

Description

expires_at

Type: string<date-time>

Expiration time for a signed link. Omitted when the link does not expire.

Example: 2025-01-01T00:00:00Z

link

Type: string

Link for downloading the complete Git-compatible unified diff from the first parent to the requested commit.

Example: example

default

Both Client Errors (4xx) and Server Errors (5xx) are serialized into this scheme

Body

application/json
{
  "error_code": "example",
  "message": "example",
  "request_id": "example",
  "details": null
}

Name

Description

details

Type: unknown

Example: null

error_code

Type: string

Example: example

message

Type: string

Example: example

request_id

Type: string

Example: example