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 |