Skip to content

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.

id
required
string

The task id.

Example

t3k9x2a1b2

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.

Media typeapplication/json
object
error
required

What went wrong

string

Example generated

{
"error": "example"
}

GurtOS is open source under the Apache License 2.0.Source code on GitHub.