Skip to content
GitmoapAPIBeta
Schema

DiffFileResponse

One file's diff, force-expanded — the response of GET .../diff-file. Keyed on the base/head SHAs the batch diff already returns, so it is snapshot-consistent with (and cacheable independently of) the batch view.

Shape

  • base_shaCommitHash (string)
  • fileDiffFileThe single file, with its patch inlined (collapsed is always false). A genuinely oversized patch still sets patch_truncated; the client then falls back to GET .../file-lines.
    • 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
  • head_shaCommitHash (string)

Example

Synthesized example
{
"base_sha": "ea3654d377f67f047622746d1a6476565dc20833",
"file": {
"additions": 35,
"collapsed": false,
"deletions": 76,
"generated": false,
"is_binary": false,
"patch_truncated": false,
"path": "path-ae19",
"status": "added",
"collapse_reason": "generated",
"old_path": "old-path-c588",
"patch": "patch-5448"
},
"head_sha": "159c34f0de7aa6cc323a4727ca2005bb9d5cf2e1"
}

Graph

Used inside

No schema contains this one.

Contains

Used by

Sent by 0 operations

No operation takes it as a request body.