git-review

raw JSON →
2.5.0 verified Fri May 01 auth: no python maintenance

git-review is a command-line tool that simplifies submitting code changes to Gerrit code review. Version 2.5.0, released 2024-04-15, supports Python >=3.6. It wraps git operations like push, rebase, and review requests. Maintenance mode with low release cadence.

pip install git-review
error RuntimeError: Not a git repository
cause Command was run outside a git repository.
fix
Ensure you are inside a git repository: 'cd /path/to/repo' then run command.
error git: 'review' is not a git command. See 'git --help'.
cause The git-review package is not installed or not in PATH.
fix
Install with 'pip install git-review' and check that the 'git-review' executable is available.
error ImportError: No module named 'git_review'
cause Trying to import the package inside Python, but the module is named 'git_review' (with underscore), not 'gitreview'.
fix
Use 'from git_review import main' instead of 'import gitreview'.
gotcha git-review is installed as a Python package but used via 'git review' command (not 'git-review'). The pip executable might conflict with the git wrapper.
fix After installing, ensure 'git-review' executable is in PATH, and use 'git review' (with space) as a git subcommand.
deprecated Python 3.6 support is deprecated in version 2.5.0. Future releases may drop support.
fix Upgrade to Python 3.8+ for compatibility with future versions.
breaking In git-review 2.0+, the configuration file format changed from ~/.gitreview to using git config sections.
fix Update configuration: use 'git config --global gitreview.*' instead of .gitreview file.
gotcha git-review requires the current directory to be inside a Git repository. Running outside will raise a RuntimeError.
fix Change to a Git repository directory before calling git review.

Programmatic entry point for git-review. The CLI tool is invoked via 'git review' command, but the Python package can be accessed via 'git_review' module.

from git_review import main
import sys
if __name__ == '__main__':
    # Simulate 'git review' command-line invocation
    sys.argv = ['git-review', '--help']
    main()