Compare exact Git commits
gh_compare_commitsCompare two exact 40-character commit SHAs in a GitHub repo to get merge-base status, commit metadata, and changed files with completeness indicators and SHA-256 fingerprints.
Instructions
Read-only: compare two exact 40-character commit SHAs without branch or tag resolution. Returns explicit merge-base/status evidence plus independently bounded commit and changed-file metadata with completeness and SHA-256 fingerprints.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | GitHub repository name without the owner prefix. | |
| owner | Yes | GitHub repository owner or organization login. | |
| base_sha | Yes | Exact 40-character hexadecimal base commit SHA. | |
| head_sha | Yes | Exact 40-character hexadecimal head commit SHA. | |
| max_files | No | Maximum changed-file metadata records to return. Defaults to the server result limit; the implementation retains a strict bound below GitHub's 300-file upstream saturation point so incompleteness is never ambiguous. | |
| max_commits | No | Maximum commit records to return. Defaults to the server result limit and cannot exceed GitHub's 100-commit comparison page limit. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | ||
| sha256 | Yes | ||
| status | No | ||
| commits | Yes | ||
| warning | No | ||
| ahead_by | No | ||
| base_sha | Yes | ||
| head_sha | Yes | ||
| behind_by | No | ||
| truncated | Yes | ||
| base_found | Yes | ||
| head_found | Yes | ||
| total_commits | No | ||
| files_evidence | Yes | ||
| merge_base_sha | No | ||
| commits_evidence | Yes | ||
| evidence_complete | Yes | ||
| comparison_available | Yes |