--- name: gerrit description: Work with Gerrit code review using git-review CLI. Use when submitting changes, downloading patches, and managing code reviews in Gerrit. metadata: author: odyssey4me version: "0.1.0" license: MIT --- # Gerrit Skill This skill provides guidance for working with Gerrit code review using the `git-review` CLI tool. All Gerrit operations (submitting changes, downloading patches, reviewing code) are performed using `git-review` commands. ## Prerequisites **Install git-review**: Quick install: ```bash # Using pip (recommended) pip install git-review # macOS brew install git-review # Debian/Ubuntu sudo apt install git-review # Fedora/RHEL/CentOS sudo dnf install git-review ``` ## Authentication git-review uses SSH for authentication with Gerrit servers. ```bash # Configure Gerrit username (if different from local user) git config --global gitreview.username yourgerrituser # Test SSH connection ssh -p 29418 youruser@review.example.com gerrit version # Add SSH key to Gerrit # 1. Generate SSH key if needed: ssh-keygen -t ed25519 # 2. Copy public key: cat ~/.ssh/id_ed25519.pub # 3. Add to Gerrit: Settings > SSH Keys ``` Gerrit supports multiple authentication methods: - **SSH** (recommended): Used by git-review for all operations - **HTTP/HTTPS**: For web UI and REST API access (set password in Settings > HTTP Password) See [Gerrit Authentication](https://gerrit-review.googlesource.com/Documentation/user-upload.html#ssh) for details. ## Initial Setup ### Configure Repository ```bash # One-time setup for a repository git review -s # Or manually create .gitreview file in repository root cat > .gitreview < SSH Keys) # Or configure username: git config --global gitreview.username youruser ``` **Change-Id missing** ```bash # Install commit-msg hook curl -Lo .git/hooks/commit-msg \ https://review.example.com/tools/hooks/commit-msg chmod u+x .git/hooks/commit-msg # Or let git-review install it git review -s ``` ## Official Documentation - **git-review Manual**: - **git-review Repository**: - **Gerrit Documentation**: - **Gerrit SSH Commands**: ## Summary The Gerrit skill uses `git-review` CLI exclusively. No custom scripts are needed - `git-review` provides comprehensive functionality for all Gerrit code review operations. **Quick start:** 1. Install: `pip install git-review` 2. Setup: `git review -s` (in repository) 3. Submit: `git review` 4. Download: `git review -d 12345` For detailed command reference, use `git review --help` or visit .