Skip to main content

Command line tool to interact with gerrit change requests

Project description

git-gerrit

Command line to to interact with gerrit codereview service and its ci integrations. Made for internal use but could be useful for others too.

Installation

pip install gitgerrit

After the package has been installed, its available via git gerrit.

Configuration

  • Generate HTTP Password in Gerrit web ui.
  • git config --add gerrit.host hostname.of.your.gerrit.instance
  • git config --add gerrit.user your_user_name
  • git config --add gerrit.token your_http_password
  • `git config --add gerrit.prevent_build_topic noci

Or alternative, you can set the same values into following environment variables:

  • GERRIT_HOST
  • GERRIT_USER
  • GERRIT_TOKEN
  • GERRIT_PREVENT_BUILD_TOPIC

If you need to modify the the comment used by runverify action, you can optionally add env GERRIT_TRIGGER or gerrit.trigger git configuration option. If not set, defaults to runverify but you could also set it to artifactoryupload on repo basis.

prevent_build_topic is a topic that is configured in the ci typically means that commits with that topic will not be build. This is helpful when working with commit chains (--support-chain flag) and only the HEAD of the relation should be build, not all the parents leading to the HEAD. If not set, defaults to NOCI

Usage

git-gerrit either works on current commit of the checked out repository if no --commit or --changeid wherent provided.

By default, git-gerrit operates on a single commit. If you want to apply your actions to each commit that are submitted together, provide --support-chain argument before action.

you can also specify logging level via --loglevel=$level flag.

After the optional paremters that affect what change requests are being operated on, you need to provide the keyword that defines what action is taken against change(s)

Actions

runverify

Can either print out the current votes on latest revision of change(s) or adds "runverify" message to the latest revision to trigger a ci build of your current changes.

"runverify" trigger message can be customized by setting gerrit.trigger git config or by GERRIT_TRIGGER environment variable.

For more details: git gerrit runverify -h

topic

Can set or get topic into change(s)get or set topic on change(s)

For more details: git gerrit runverify -h

hashtag

Get, add or remove hashtag(s) on change(s). --add and --del flags be added to command line multiple times in order to add or remove multiple hashtags in one call. If no hashtags are given, defaults to adding a current branch name to change(s) list of hashtags

For more details: git gerrit hashtag-h

wip

Marks change(s) as Work-In-Progress indicating that no reviewing required at the moment.

For more details: git gerrit wip -h

ready

Marks change(s) as Ready-For-Review indicating that your changes are ready for a review

For more details: git gerrit ready -h

private

Marks change(s) as Private. Only people who have been added as reviewers can see the change(s)

For more details: git gerrit private -h

public

Marks change(s) as Public. Everyone with the access to the project can then see your change(s)

For more details: git gerrit public -h

prepare

Prepares change(s) to be ready for merge. This is a group actions:

  • Marks changes(s) as Ready-For-Review
  • Marks changes(s) as Public
  • Changes all changes(s) expect HEAD topic's into NOCI to avoid multiple builds when merged.
  • Adds HEAD's topic as hashtag to change(s)

For more details: git gerrit prepare -h

abandon

Abandon change(s) For more details: git gerrit abandon -h

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitgerrit-0.0.16.tar.gz (26.9 kB view details)

Uploaded Source

File details

Details for the file gitgerrit-0.0.16.tar.gz.

File metadata

  • Download URL: gitgerrit-0.0.16.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.7.9

File hashes

Hashes for gitgerrit-0.0.16.tar.gz
Algorithm Hash digest
SHA256 8001716a85832d62128f856a98b7440a50382b83dff1a7c6e492aa0ce8daeab0
MD5 9d2e16a578dd02d58a9e2630504ed08c
BLAKE2b-256 ba19f102a4b56cdf42e872b5cf77a9c122bdac82e3ab7221336e371d34bb53b0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page