SandboxesGit

Get a git patch

Return the staged, unstaged and untracked, not ignored changes against base as one unified patch.

  • Run git apply -p1 in the work tree root to apply it. Binary files are included.
  • A patch above 6 MiB stops after its last complete file and sets Tektona-Git-Truncated: true.
  • The index of the repository does not change.
  • Runs in the sandbox as the image user. Needs write access to the sandbox, because git runs the repository's own config and filters.
  • Served at the access endpoint of the sandbox (access_endpoint of GET /v1/sandboxes/{sandboxId}), not at the API host.
  • A paused sandbox returns 409 sandbox_paused, unless resume=true. A sandbox that started before its files server existed returns 409 sandbox_update_required until it restarts.
  • A refused operation returns its code as the problem type and in the Tektona-Files-Error header.
  • A path that starts with ~ or ~/ names the home directory of the user that the operation runs as. ~name returns 422.
GET
/v1/sandboxes/{sandboxId}/git/patch
AuthorizationBearer <token>

API key starting with tektona_. Create one at app-dev.tektona.sebastian-holstein.de under API Keys.

In: header

Path Parameters

sandboxId*string

Sandbox ID (ULID)

Query Parameters

path?string

A directory inside the work tree: absolute, or relative to the sandbox working directory

Default"."
resume?boolean

Wake a paused sandbox to serve this request

base?string

Revision to compare the working tree with; defaults to HEAD

Match^[^-\x00\n\r][^\x00\n\r]*$
file?array<string>|

Limit the patch to these paths, relative to the work tree root and read literally (no globs). Repeat for more files

Itemsitems <= 1000
context?integer

Lines of context around each change

Formatint32
Range0 <= value <= 1000
Default3

Response Body

text/x-diff

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://example.com/v1/sandboxes/string/git/patch"

The body is not JSON: text/x-diff

Get git log GET

List the commits of `ref`, newest first. - A history with more than `limit` commits returns `pagination.next_cursor`. Pass it as `cursor` to list older commits. The pages follow the commit that `ref` named on the first page. - More than 6 MiB of commit data on one page returns 413 `too_large`. Use a lower `limit`. - Runs in the sandbox as the image user. Needs write access to the sandbox, because git runs the repository's own config and filters. - Served at the access endpoint of the sandbox (`access_endpoint` of `GET /v1/sandboxes/{sandboxId}`), not at the API host. - A paused sandbox returns 409 `sandbox_paused`, unless `resume=true`. A sandbox that started before its files server existed returns 409 `sandbox_update_required` until it restarts. - A refused operation returns its code as the problem type and in the `Tektona-Files-Error` header. - A path that starts with `~` or `~/` names the home directory of the user that the operation runs as. `~name` returns 422.

Get git status GET

Return the branch, upstream and changed files of the work tree that contains `path`. - Runs in the sandbox as the image user. Needs write access to the sandbox, because git runs the repository's own config and filters. - Served at the access endpoint of the sandbox (`access_endpoint` of `GET /v1/sandboxes/{sandboxId}`), not at the API host. - A paused sandbox returns 409 `sandbox_paused`, unless `resume=true`. A sandbox that started before its files server existed returns 409 `sandbox_update_required` until it restarts. - A refused operation returns its code as the problem type and in the `Tektona-Files-Error` header. - A path that starts with `~` or `~/` names the home directory of the user that the operation runs as. `~name` returns 422.