The branch diff (GitHub's three-dot diff, merge base to head)
Computed in the Worker from Artifacts reads, with no clone: the merge
base, a walk of the two trees that skips equal subtrees, the changed
blobs only, and a line diff (patience, then bounded Myers between its
anchors, as git diff --patience). Exact renames (the same blob
moved) show as renamed; there is no similarity rename detection.
max_bytes bounds the bytes of hunk lines returned. Files past the
budget keep their entry with patch_omitted: budget. A text file over
8 MiB on either side has patch_omitted: too_large and null counts.
Files changed (patches=1): the answer is a BranchDiff, each
file with its own unified patch in git's format (patch, ready for a
diff view such as @pierre/diffs' processFile), or null when left
out: a binary (a NUL in the first 8,000 bytes), a text file over 8 MiB
on either side, or past 2 MiB of patches in all. At most 1,000 files
are listed (too_many_files, with files_total). Main and the head
come from Pando's stored heads; the answer is kept by (main, head),
which never changes, so a repeat costs no Artifacts read, and ETag
is the two shas (a repeat with If-None-Match is a 304). format,
hunks, max_bytes and paths do not apply.
Files changed, streamed (patches=1&stream=1, the web's branch
page, for a branch of any size): application/x-ndjson, one
BranchDiffLine a line, each sent as soon as it is known: start
(the ends, the merge base, files_total, too_many_files), then one
file per changed file (a DiffFile with its patch) in a file tree's order
(folders before files at each level, by name), then end (stats,
truncated); error if the diff fails after its start. At most 5,000
files, and 32 MiB of patches in all. Each pair of blobs diffed is kept
in R2, so the next head of a branch reads only the pairs a push
changed; the whole answer is kept by (main, head) once streamed, and
streamed from there after with the same ETag and 304. An answer
being computed has no ETag (Cache-Control: no-store): it may stop
part way, with an error line, and the next request goes on from the
pairs already kept.
https://app.gitpando.com/v1/monorepos/{owner}/{monorepo}/repos/{repo}/branches/{branch}/diffAuthorisation
Path parameters
Query parameters
Returns
200
JSON (a BranchDiff with patches=1), or text/x-patch for format=patch: a unified diff with
diff --git headers, ready for git apply or
plannotator review --patch-file -. In patch form, files past the
budget are left out and the response carries
X-Pando-Diff-Omitted: <count>.
One of the following:
stringOne of the following:
- object
- object
- object
- object
{
"type": "start",
"base_branch": "string",
"base": "string",
"head": "string",
"merge_base": "string",
"files_total": 0,
"too_many_files": true
}304
patches=1 with If-None-Match naming this (main, head).