Skip to content
GitmoapAPIBeta
Schema

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 via GET .../file-lines instead.
    • pathstring
    • statusDiffFileStatusaddedmodifieddeletedrenamedcopied
    • collapse_reasonCollapseReasongeneratedlargeor nulloptionalWhy a file's patch body was withheld from a DiffFile (see collapsed). Distinct from patch_truncated, which marks a patch too large to ever send; a collapsed file's patch is fetchable on demand via GET .../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. stats still 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 by