Skip to content
GurtOS

Get what a task changed

GET
/tasks/{id}/diff
curl --request GET \
--url http://127.0.0.1:7700/api/tasks/t3k9x2a1b2/diff \
--header 'Authorization: Bearer <token>'

The files the task added, modified or deleted, read from its own layer only, and a unified diff. The diff is cut at 200,000 bytes. An undone task’s files are deleted, so its diff is empty and carries undone: true. For a task on several folders, each path starts with its folder’s label and roots maps each label to the real folder.

With at, the task’s files as they were right after that log event, read from the flight recorder (GET /tasks/{id}/replay lists the events). A file over 1 MB then has big: true and no diff.

id
required
string

The task id.

Example

t3k9x2a1b2
at
integer
>= 1

A log event’s seq. Show the task’s layer as it was right after that event.

The task’s changes.

Media typeapplication/json
object
changes
required
Array<object>
object
path
required

Path inside the workspace.

string
change
required
string
Allowed values: added modified deleted
diff
required

A unified diff of every change

string
roots

For a task on several folders, each label and the real folder it stands for.

object
key
additional properties
string
undone

Set when the task is undone and its files are gone.

boolean

Example

{
"changes": [
{
"path": "a.txt",
"change": "modified"
},
{
"path": "summary.md",
"change": "added"
}
],
"diff": "--- a/a.txt\n+++ b/a.txt\n@@ -1 +1 @@\n-original a\n+changed by A\n"
}

No task with this id, or an at that is not an event number.

Media typeapplication/json
object
error
required

What went wrong

string

Example generated

{
"error": "example"
}