DiffResponse
One page of a diff's files, in path order, with patches when they were asked for.
Shape
- base_shaCommitHash (string)
filesarray of DiffFile
- The DiffFile schema
- additionsinteger0–∞
- collapsedbooleanThe patch was intentionally withheld (generated or oversized) to save bytes but is fetchable in full on demand via
GET .../diff-file. Only ever set when patches were requested (include_patch=true). - deletionsinteger0–∞
- generatedbooleanDetected generated/lock/minified file. Always computed from the path, independent of
collapsed, so a client can badge or auto-fold it. - is_binaryboolean
- patch_truncatedbooleanThe patch exceeds the hard per-file size cap and is omitted. Unlike
collapsed, this file is not expandable in place — a client reads it piece-by-piece viaGET .../file-linesinstead. - pathstring
- statusDiffFileStatusaddedmodifieddeletedrenamedcopied
- collapse_reasonCollapseReasongeneratedlargeor nulloptionalWhy a file's patch body was withheld from a
DiffFile(seecollapsed). Distinct frompatch_truncated, which marks a patch too large to ever send; acollapsedfile's patch is fetchable on demand viaGET .../diff-file. - old_pathstring or nulloptional
- patchstring or nulloptional
- has_morebooleanAnother page follows this one.
- head_shaCommitHash (string)
- pageinteger0–∞The page returned, from 0.
statsDiffStats
- The DiffStats schema
- additionsinteger0–∞Lines added across the whole change.
- deletionsinteger0–∞Lines deleted across the whole change.
- files_changedinteger0–∞Every file the change touches.
- total_filesinteger0–∞How many files the pages can reach — every changed file, unless
truncated. - truncatedbooleanThe change touches more files than any page can reach.
statsstill counts all of them.
Example
Synthesized example{
"base_sha": "f3aa066e2d821dabda9b5b3da01778f1705a2b4a",
"files": [
{
"additions": 47,
"collapsed": false,
"deletions": 59,
"generated": false,
"is_binary": false,
"patch_truncated": false,
"path": "path-addd",
"status": "added"
}
],
"has_more": false,
"head_sha": "0cb93edb2e2ac749c44577aac2c185adf82328f5",
"page": 10,
"stats": {
"additions": 60,
"deletions": 41,
"files_changed": 13
},
"total_files": 3,
"truncated": false
}
Graph
Used inside
Used by
Sent by 0 operations
No operation takes it as a request body.
Returned by 5 operations
- GETGet diff for a commit/repositories/{repo_id}/commits/{commit_ref}/diff
- GETCompare two branches/repositories/{repo_id}/compare
- GETGet a page of the diff between two commits/repositories/{repo_id}/diff
- GETGet diff for a merge request/repositories/{repo_id}/merge-requests/{mr_id}/diff
- GETCumulative diff of a merge request's downstack/repositories/{repo_id}/merge-requests/{mr_id}/stack/diff