Package: gitgerrit
git-gerritCommand line to to interact with gerrit codereview service and its ci integrations. Made for internal use but
could be useful for others too.Installationpip install gitgerritAfter the package has been installed, its available viagit gerrit.ConfigurationGenerate HTTP Password in Gerrit web ui.git config --add gerrit.host hostname.of.your.gerrit.instancegit config --add gerrit.user your_user_namegit config --add gerrit.token your_http_password`git config --add gerrit.prevent_build_topic nociOr alternative, you can set the same values into following environment variables:GERRIT_HOSTGERRIT_USERGERRIT_TOKENGERRIT_PREVENT_BUILD_TOPICIf 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 torunverifybut you could also set it toartifactoryuploadon repo basis.prevent_build_topicis 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-chainflag) and only the HEAD of the relation should be build,
not all the parents leading to the HEAD.  If not set, defaults toNOCIUsagegit-gerriteither works on current commit of the checked out repository if no--commitor--changeidwherent provided.By default,git-gerritoperates on a single commit. If you want to apply your actions to each commit that are submitted
together, provide--support-chainargument 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)ActionsrunverifyCan 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 settinggerrit.triggergit config or by GERRIT_TRIGGER environment variable.For more details:git gerrit runverify -htopicCan set or get topic into change(s)get or set topic on change(s)For more details:git gerrit runverify -hhashtagGet, add or remove hashtag(s) on change(s).--addand--delflags 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 hashtagsFor more details:git gerrit hashtag-hwipMarks change(s) as Work-In-Progress indicating that no reviewing required at the moment.For more details:git gerrit wip -hreadyMarks change(s) as Ready-For-Review indicating that your changes are ready for a reviewFor more details:git gerrit ready -hprivateMarks change(s) as Private. Only people who have been added as reviewers can see the change(s)For more details:git gerrit private -hpublicMarks change(s) as Public. Everyone with the access to the project can then see your change(s)For more details:git gerrit public -hpreparePrepares change(s) to be ready for merge. This is a group actions:Marks changes(s) as Ready-For-ReviewMarks changes(s) as PublicChanges 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 -habandonAbandon change(s)
For more details:git gerrit abandon -h