Note Diff
get_diffCompare a note's current version to a previous commit or timestamp. Returns a unified diff for text files or a summary for binary attachments.
Instructions
Return the diff of a note between a reference point and HEAD.
Only available for git-backed vaults. Exactly one of 'since_sha' or 'since_timestamp' must be provided. Use 'get_history' first to find commit SHAs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Vault-relative path of the note or attachment to diff (e.g. "notes/alpha.md" or "assets/diagram.png"). May be a `.md` note or a configured attachment extension (png, pdf, svg, …). A binary attachment returns a `--stat` size/rename summary instead of a full unified patch; a text attachment (e.g. `.svg`, `.csv`) returns a full unified diff. `.md` notes are unchanged. An unsupported extension is rejected. | |
| limit | No | When per_commit=True, cap the number of intervening commits returned to the `limit` most recent ones. Clamped to [1, 100]. Defaults to null (unbounded — still bounded by the underlying since..HEAD range). Ignored when per_commit=False. Useful for keeping per-commit responses within context budgets when auditing long histories. | |
| since_sha | No | A commit SHA (full or abbreviated, at least 4 hex digits) to diff from. Mutually exclusive with since_timestamp. | |
| per_commit | No | When False (default), return a single unified diff from the reference point to HEAD. When True, return one diff per intervening commit. | |
| since_timestamp | No | ISO 8601 datetime string, resolved via `git rev-list --before=<ts> -1 HEAD` to the most recent commit at or before that instant. Boundary is **inclusive**: a commit whose committer date equals since_timestamp IS the resolved ref. Mutually exclusive with since_sha. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||