gitlab_smart_diff
Generate structured and customizable diffs between Git refs with configurable context lines and file size limits. Optimized for handling large comparisons efficiently.
Instructions
Get intelligent diff between refs Returns: Structured diff with smart chunking Use when: Need customizable diffs Features: Context control, size limits
Advantages over standard diff:
Configurable context lines
File size filtering
Better for large diffs
Related tools:
gitlab_get_commit_diff: Simple commit diff
gitlab_compare_refs: Basic comparison
Input Schema
Name | Required | Description | Default |
---|---|---|---|
context_lines | No | Context lines in diff Type: integer Range: 0-10 Default: 3 Examples: - 0: Only changed lines - 3: Standard context - 10: Maximum context Use case: Balance between context and size | |
from_ref | Yes | Source reference for comparison Type: string Required: Yes Format: Branch, tag, or commit SHA Examples: - 'feature/new-api' (branch) - 'v1.0.0' (tag) - 'abc123def' (commit) Use case: Starting point for comparison | |
max_file_size | No | Maximum file size for diffs Type: integer Unit: Bytes Default: 50000 (50KB) Examples: - 10000: 10KB limit - 50000: 50KB (default) - 100000: 100KB for larger files Use case: Prevent huge diffs from overwhelming output | |
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 | |
to_ref | Yes | Target reference for comparison Type: string Required: Yes Format: Branch, tag, or commit SHA Examples: - 'main' (branch) - 'v2.0.0' (tag) - '456789abc' (commit) Use case: Ending point for comparison |
Input Schema (JSON Schema)
{
"properties": {
"context_lines": {
"default": 3,
"description": "Context lines in diff\nType: integer\nRange: 0-10\nDefault: 3\nExamples:\n - 0: Only changed lines\n - 3: Standard context\n - 10: Maximum context\nUse case: Balance between context and size",
"type": "integer"
},
"from_ref": {
"description": "Source reference for comparison\nType: string\nRequired: Yes\nFormat: Branch, tag, or commit SHA\nExamples:\n - 'feature/new-api' (branch)\n - 'v1.0.0' (tag)\n - 'abc123def' (commit)\nUse case: Starting point for comparison",
"type": "string"
},
"max_file_size": {
"default": 50000,
"description": "Maximum file size for diffs\nType: integer\nUnit: Bytes\nDefault: 50000 (50KB)\nExamples:\n - 10000: 10KB limit\n - 50000: 50KB (default)\n - 100000: 100KB for larger files\nUse case: Prevent huge diffs from overwhelming output",
"type": "integer"
},
"project_id": {
"description": "Project identifier (auto-detected if not provided)\nType: integer OR string\nFormat: numeric ID or 'namespace/project'\nOptional: Yes - auto-detects from current git repository\nExamples:\n - 12345 (numeric ID)\n - 'gitlab-org/gitlab' (namespace/project path)\n - 'my-group/my-subgroup/my-project' (nested groups)\nNote: If in a git repo with GitLab remote, this can be omitted",
"type": "string"
},
"to_ref": {
"description": "Target reference for comparison\nType: string\nRequired: Yes\nFormat: Branch, tag, or commit SHA\nExamples:\n - 'main' (branch)\n - 'v2.0.0' (tag)\n - '456789abc' (commit)\nUse case: Ending point for comparison",
"type": "string"
}
},
"required": [
"from_ref",
"to_ref"
],
"type": "object"
}