gitlab_get_commit_diff
Extract detailed commit differences for code review, showing added/removed lines and file modifications. Integrates with MCP GitLab Server to simplify change analysis and improve understanding of GitLab project updates.
Instructions
Get commit diff/changes Returns: Detailed diff of all changed files Use when: Code review, understanding changes Shows: Added/removed lines, file modifications
Example response: [{ "old_path": "src/main.py", "new_path": "src/main.py", "diff": "@@ -10,3 +10,5 @@\n def main():\n- print('Hello')\n+ print('Hello, World!')\n+ return 0", "new_file": false, "deleted_file": false }]
Related tools:
gitlab_get_commit: Commit metadata
gitlab_compare_refs: Compare branches
gitlab_smart_diff: Advanced diff options
Input Schema
Name | Required | Description | Default |
---|---|---|---|
commit_sha | Yes | Commit SHA | |
project_id | No | Project identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted |