get_diff
Get the diff of a pull request, optionally returning only a list of changed files with line counts. Limit diff to a specific file or configure context lines.
Instructions
Get the diff of a pull request. Use stat=true for a lightweight summary of changed files (and line counts if the server supports it) instead of the full diff.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prId | Yes | Pull request ID. | |
| stat | No | If true, return only the list of changed files and types (ADD, MODIFY, DELETE, RENAME, COPY) instead of the full diff. Line count summary included when available (Bitbucket DC 9.1+). | |
| project | No | Project key. Defaults to BITBUCKET_DEFAULT_PROJECT. | |
| filePath | No | Path to a specific file to get the diff for. Use with stat=true first to discover file paths, then request individual diffs. | |
| repository | Yes | Repository slug. | |
| contextLines | No | Number of context lines around changes (default: 10). Ignored when stat=true. | |
| maxLinesPerFile | No | Max lines per file. 0 = no limit. Defaults to BITBUCKET_DIFF_MAX_LINES_PER_FILE. Ignored when stat=true. |