gitlab_safe_preview_commit
Validate and preview GitLab commit changes without applying them. Checks affected files, permissions, file paths, and potential errors. Use to ensure accuracy and safety before committing.
Instructions
Preview commit without creating Returns: What would change, validation results Use when: Validating before actual commit Shows: Affected files, potential errors
Safety features:
No actual changes made
Validates file paths
Checks permissions
Related tools:
gitlab_create_commit: Actual commit
gitlab_list_repository_tree: Check files exist
Input Schema
Name | Required | Description | Default |
---|---|---|---|
actions | Yes | File operations for commit Type: array of objects Required: Yes Max items: 100 per commit Structure: { "action": "create" | "update" | "delete" | "move", "file_path": "string (required)", "content": "string (required for create/update)", "encoding": "text" | "base64" (optional, default: text)", "previous_path": "string (required for move)" } Examples: [ { "action": "create", "file_path": "src/config.json", "content": "{"debug": true}" }, { "action": "update", "file_path": "README.md", "content": "# Updated README\n\nNew content here" }, { "action": "delete", "file_path": "old-file.txt" }, { "action": "move", "file_path": "new-location/file.txt", "previous_path": "old-location/file.txt" } ] Use cases: - create: Add new files - update: Modify existing files - delete: Remove files - move: Rename or relocate files | |
branch | Yes | Target branch for commits Type: string Required: Yes Format: Existing branch name Examples: - 'main' (commit to main) - 'feature/add-login' (feature branch) - 'hotfix/security-patch' (hotfix branch) Note: Branch must exist before committing | |
commit_message | Yes | Commit message Type: string Required: Yes Format: Conventional commits recommended Structure: - First line: Summary (50-72 chars) - Blank line - Body: Detailed description - Footer: References, breaking changes Examples: 'feat: Add user authentication Implement JWT-based authentication with refresh tokens. Store tokens securely in httpOnly cookies. Closes #123' | |
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 |