Skip to content

diff

Show a unified diff between two refs (commit SHAs or branch names) of a Bridge Town project. Refs are detected automatically: a ref consisting of 7–40 hexadecimal characters is treated as a commit SHA; anything else is treated as a branch name. Use list_versions to find commit SHAs. The diff shows exactly what changed between ref_a and ref_b across all files, or only the specified file when path (e.g. model/revenue.py, README.md) is provided. Binary files behave like git: you may see a Binary files ... differ marker or no hunk text at all. The response always remains structured — has_changes is true when the (filtered) diff still contains any text after stripping whitespace. Returns: project (str) — project name; ref_a (str) — first ref (older); ref_b (str) — second ref (newer); path (str|null) — path filter applied; diff (str) — unified diff text (may be empty or contain binary markers); has_changes (bool) — false when ref_a and ref_b are identical or the filtered diff is empty.

read-only

NameTypeRequiredDefaultDescription
project_namestrYes
ref_astrYes
ref_bstrYes
pathstrNo''

Returns a structured object. Top-level fields:

  • project (string)
  • ref_a (string)
  • ref_b (string)
  • model_name (string)
  • diff (string)
  • has_changes (boolean)

See the response example below for the full payload shape.

{
"name": "diff",
"arguments": {
"project_name": "forecasts",
"ref_a": "0123456789abcdef0123456789abcdef01234567",
"ref_b": "abc1234def5678901234567890abcdef12345678",
"model_name": "revenue"
}
}
{
"project": "forecasts",
"ref_a": "0123456789abcdef0123456789abcdef01234567",
"ref_b": "abc1234def5678901234567890abcdef12345678",
"model_name": "revenue",
"diff": "diff --git a/model/revenue.py b/model/revenue.py\n@@\n-growth_rate = 0.10\n+growth_rate = 0.15\n",
"has_changes": true
}
  • Module: Versions
  • Requires authentication via API token or Auth0 JWT.