Skip to main content

gri : Git Reduced Interface

gri is a CLI tool that lists git reviews from multiple servers in a way that makes easier to to identify which one need you attention.

Currently supported backends are Gerrit and GitHub but it should be easy to add others if needed.

screenshot

Features

  • combines results from multiple Gerrit or GitHub servers
  • uses terminal clickable links to make it easy to access these reviews
  • displays important metadata related to reviews in a compressed format
  • reviews are sorted based on probablility of getting merged
  • allows user to abandon very old reviews
  • can be used to query:
    • already merged reviews
    • incoming reviews (where you are a reviewer)
    • reviewes created by other users than yourself
  • produce HTML reports

Installing

pip install gri

Usage

You can just run gri, or python -m gri in order to get a list of your current reviews, aslo known as outgoing reviews.

GRI uses a simple config file ~/.config/gri/gri.yaml but when the file is missing, it will try to load servers from ~/.gertty.yaml in case you have one.

$ gri --help
Usage: gri [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

Options:
  -a, --abandon              Abandon changes (delete for drafts) when they are
                              >90 days old and with negative score. Requires -f
                             to perform the action.
  -z, --abandon-age INTEGER  default=90, number of days for which changes are
                             subject to abandon
  -u, --user TEXT            Query another user than self
  -s, --server TEXT          [0,1,2] key in list of servers, Query a single
                             server instead of all
  -o, --output TEXT          Filename to dump the result in, currently only
                             HTML is supported
  -f, --force                Perform potentially destructive actions.
  -d, --debug                Debug mode
  --help                     Show this message and exit.

Commands:
  incoming  Incoming reviews (not mine)
  merged    merged in the last number of days
  owned     Changes originated from current user (implicit)

There is also an experimental grib command line for quering bugs (issues), which has almost identical options.

Configuring

Unless you already have a GerTTY config, here is how to configure the tool:

# ~/.config/gri/gri.yaml
servers:
- name: opendev  # server 0, select it with '-s 0'
  url: https://review.opendev.org/
- name: rdo  # server 0, select it with '-s 1'
  url: https://review.rdoproject.org/r/
  auth-type: basic  # needed only for old gerrit versions

You may be surprised to observe that the credentials are not stored inside the same file. That is by design and the tool will load them from ~/.netrc file, which is also the standard way to place network related credentials.

# ~/.netrc
# password is the token generated by gerrit on your user settings page
machine review.rdoproject.org login jonhdoe password changeme

Contributing

Are you missing a feature, just check if there is a bug open for it and add a new one if not. Once done, you are welcomed to make a PR that implements the missing change.

Related tools

  • git-review is the git extension for working with gerrit, where I am also one of the core contributors.
  • gertty is a very useful tui for gerrit which inspired me but which presents one essential design limitation: it does not work with multiple Gerrit servers.
  • gerrit-view is a vscode plugin that can be installed from Visual Studio Marketplace.

Notes

  1. gri name comes from my attempt to find a short name that was starting with g (from git/gerrit) and preferably sounds like cli.

Release files for gri 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gri 0.6.1
File Size Uploaded
gri-0.6.1.tar.gz 19.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gri 0.6.1
File Interpreter ABI Platform
gri-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 36.5 kB

Release files / gri-0.6.1.tar.gz

Download URL gri-0.6.1.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6ccec3ac9a302361d8220447f0ac95226faf498f9207bec5dc9e8fa6c5e41c10
BLAKE2b-256 checksum
How to use checksums
d9aec3cf36ff3c1c56a9ced94c3fdf6ae74785100dda6b2a39eed76d712ab979
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.6

Release files / gri-0.6.1-py3-none-any.whl

Download URL gri-0.6.1-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21dd345321495f8f0066be3a81a9ac9fefddf92becf8ea3293547d78f6f55d76
BLAKE2b-256 checksum
How to use checksums
50b1a71b42869d5ff099e83b20099485999f2e0a0ba1c2543ebfab62cf9842a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files

0.6

2 release files

0.5.1

2 release files

0.5

2 release files

0.4

2 release files

0.2

2 release files

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page