Diff two committed versions
vc_diffCompare two committed versions of a record or the entire repo to see what changed before deciding to revert. Defaults to showing the last change, and accepts specific hashes for any pair.
Instructions
Unified diff between two committed versions — of one record (resource + id) or the whole repo. Defaults answer "what did the last change change?": ref_b = HEAD, ref_a = the previous commit touching the record (or HEAD's parent repo-wide). Pass hashes from vc_log for any pair. Inspect the diff BEFORE restore_resource so a revert is never blind. Requires PORTAL_VC_DIR.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Record id (requires resource). | |
| ref_a | No | Older ref/hash (default: the commit before ref_b for this record). | |
| ref_b | No | Newer ref/hash (default HEAD). | |
| resource | No | Record kind to scope to, e.g. 'block' or 'layout' (with id). | |
| max_chars | No | Cap the diff text (default 40000 chars; the file list is always complete). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| diff | Yes | ||
| note | No | ||
| ref_a | Yes | ||
| ref_b | Yes | ||
| truncated | Yes | ||
| files_changed | Yes |