gerrit-rust
is a console client for gerrit written in rust. This is a rust
learner project. Have patience with me :-)
Currently tested with Gerrit V02.09 and V02.13.
Common github workflow: fork, clone, branch, commit, push and then pullrequest. I'm happy about every PR, but I will ask questions about changes to learn from your knowledge.
- A installed
git
binary in$PATH
- gerrit server with installed download-plugin
Some design considerations here. Implemented features marked with [x]
. All
other ideas are todos and marked with [ ]
.
-
semver at version 1.0.0. Before this version no semver!
-
remove external depency to host
- git binary
- gerrit with download plugin
-
manage of topics over more than one repository (git submodules like)
-
0.1.0
ggr topic forget <BRANCHNAME> [-R]
Delete a branch at mainfolder and and with-R
in all subfolders.- Add option
-s
in conjunction with-R
to remove all branches recursive which have no commit and the repositories are clean. Warn unclean repositories/branches.
- Add option
-
0.1.8
ggr topic checkout <BRANCHNAME>
Checkout a branch on all repositories.- 0.1.8 first check base folder if checkout happened sync all submodules than checkout changes for topic on subfolders
-
0.1.7
ggr topic pull ...
same asggr topic fetch
. This sub function is renamed becausefetch
is more in line with git speak thanpull
. -
0.1.8
ggr topic fetch [-f] [-b branchname] <topicname>
fetch latest version of commits for a topic. Create for all changes a branch with the patch identifier as name, or with-b
with a given branchname.- 0.1.9 Add tracking information via
--track <branch>
option. - 0.1.14 Add
--closed
option to pull closed (merged) topics - 0.1.21 Add
-a
get history of topic. Seetopic history
.
- 0.1.9 Add tracking information via
-
0.1.21
ggr topic history <topicname>
fetch all versions of all changes within as tags. The tag format isggr/<topicname>/<topicid>
. Thetopicid
is the reference number plus version of the patch. -
0.1.17
ggr topic reviewer [<TOPIC>] [-r <+/-MAIL>,...]
Add(+) or remove(-) reviewer (-r
) from topic. Without an option we receive a list of all reviewers on this topic.- 0.1.17
-v
/--verbose
for detailed view of approvals - Without TOPIC it used the actual topic (!=master) on base and submodules.
- Add
--format
option for formating of output. Using of rust variable and formating informations like{email}
,{email:15.2}
.
- 0.1.17
-
0.1.18
ggr topic abandon|restore [<TOPIC>]
Abandon/restore a complete topic.- Without TOPIC it uses the actual topic
- 0.1.18
[-m <MESSAGE>]
adds a abandon message to all changes in this topic -
[-n <NONE|OWNER|REVIEWERS|ALL>]
notifiy a group of accounts about this abandon action or don't notify (viaNONE
). Default isALL
.
-
0.1.19
ggr topic verify [<TOPICNAME>] [-c <code-review>] [-l "<revie-label>"] [-m <MESSAGE>]
Gerrits labels are configurable on server side. Via-l
option the label can be accessed. (e.g.-l "Code-Review:2"
). Option-c <VALUE>
is a convenient option for-l "Code-Review:<VALUE>"
. Currently only-2/-1/0/1/2
as values for labels possible. Additionaly a message can appended on all commits of a topic.- 0.1.21 Without option a overview of review process is printed
-
-
Query changes
-
0.1.0
ggr changes query <QUERY>
query a searchstring to gerrit server. Use asQUERY
the same syntax as in gerrit web frontend. eg-
0.1.7 Add
--regexp-selector
to show only keys selected by regular expression. This remove the --fields selector introduced in 0.1.4. -
0.1.6 Add a
--human
option to print it in human readable format. -
0.1.4 Add
--field-list
to get all selectable fields, usable for--fields
option on a second call. -
0.1.4 Add
--raw
for json in raw format. Usable for pretty printer over pipe -
0.1.4 Option
-o
/--ofields
to get additional information of changes back (like REVISION etc ...)
Examples:
ggr changes query status:open is:watched n:2
: query open changes whichwatched
flag.
-
-
-
0.1.5 Use of curl-rs as http client
-
0.1.0 Use a config file
.ggr.config
in TOML format-
api
: base url with schema (http) -
0.1.3 User authentication (deprecated since 0.1.9)
username
: username for loginpassword
: password for login [x] 0.1.9 only.netrc
settings are respected for username and password. u/p in config file are ignored
-
root
: true if this is the uppermost project of all repositories underneath -
Authentication (e.g.: digest, basic)
-
digest
andbasic
are supported. Current implementation calls both. First one isbasic
and second one isdigest
.
-
-
Consider to configure via config file or put all settings into as entries in
.git/config
.
The values are same for config file and git-config approach. For the git-config we useggr-
as a prefix. -
provide a configuration frontend
-
ggr config set baseurl 'http://localhost'
: set newbaseurl
-
ggr config unset -C project1 root
: removeroot
in project1 repository -
ggr config set root
: set root for current repository - 0.1.0
ggr config list
: list all options- ... with origin of setting
-
ggr config generate --base <...> ...
: generates a.ggr.config
file
-
-
0.1.9 Use
$HOME/.netrc
file to get username and password.
-
-
add a
--dry-run
option to print what we want to do, but we don't do it- changes fetch
- gerritapi changes abandonchange
- gerritapi changes create
- topic fetch
- topic abandon
- topic checkout
- topic create
- topic fetch
- topic forget
- 0.1.21 topic history
- topic restore
- topic reviewer
- topic verify
-
Library features
-
0.1.16 cli needs a subcommand to do lowlevel task -> gerritapi
-
0.1.0 implement base for http requests and responses
-
build a feature complete library to work with gerrit servers
- access endpoint
- accounts endpoint
- changes endpoint
- 0.2.0 Create change
- 0.2.0 Query Changes
- 0.2.4 Get Change
- 0.2.4 Get Change Detail
- Get Topic
- Set Topic
- Delete Topic
- Abandon Change
- 0.2.2 Restore Change
- 0.2.2 Rebase Change
- Move Change
- Revert Change
- Submit Change
- Changes Submitted Together
- Publish Draft Change
- Delete Draft Change
- Get Included In
- Index Change
- List Change Comments
- List Change Drafts
- Check Change
- Fix Change
- reviewer endpoint
- 0.2.1 List Reviewers
- Suggest Reviewers
- 0.2.1 Get Reviewer
- 0.2.1 Add Reviewer
- 0.2.1 Delete Reviewer
- List Votes
- Delete Vote
- Revision Endpoints
- Get Commit
- Get Revision Actions
- Get Review
- Get Related Changes
- 0.2.3 Set Review
- Rebase Revision
- Submit Revision
- Publish Draft Revision
- Delete Draft Revision
- Get Patch
- Get Mergeable
- Get Submit Type
- Test Submit Type
- Test Submit Rule
- List Revision Drafts
- Create Draft
- Get Draft
- Update Draft
- Delete Draft
- List Revision Comments
- Get Comment
- List Files
- Get Content
- Download Content
- Get Diff
- Get Blame
- Set Reviewed
- Delete Reviewed
- Cherry Pick Revision
- config endpoint
- 0.2.0 Get Version
- Get Server Info
- Confirm Email
- List Caches
- Cache Operations
- Get Cache
- Flush Cache
- Get Summary
- List Capabilities
- List Tasks
- Get Task
- Delete Task
- Get Top Menus
- Get Default User Preferences
- Set Default User Preferences
- Get Default Diff Preferences
- Set Default Diff Preferences
- groups endpoint
- plugins endpoint
- projects endpoint
-
-
Removed functionality
-
ggr topic create <BRANCHNAME> [-r sub:rev]
Removed since 0.1.22, use insteadgit submodule foreach 'git branch <topicname>; true'
Old functionality:
Create branch at main folder and specified subfolders. If a branch with same name exists it isn't touched.
rev
is the reference where branch should created Defaults toorign/master
. For base folder use-r .
.
-
-
Other Ideas
-
0.1.9 implement a log mechanism to get debugging information via loglevel switch
-
0.1.20
ggr changes fetch CHANGEID
Fetchs a changeid CHANGEID and his ancestors. The branch name is the CHANGEID name. -
0.1.16 do work to support more than one gerrit server
-
0.1.14 create a helper script for setup of development environment
- docker based gerrit server
found docker imagedocker pull openfrontier/gerrit
- setup password and username for gerrit
- autogenerate git repositrories and submodules
- setup gerrit for this repositories
- auto push master branches to gerrit
- docker based gerrit server
-
ggr stat [-F <date>] [-T <data>]
some statistics like opened and closed review since a week or between a timespan. via iso-8601 likedate -Is
.Examples:
ggr stat -F 1w
: last week to nowggr stat -F 2015-12-31 -T 2016-02-01
: from 01.01.2016T00:00 till 01.02.2016T23:59:59ggr stat -F 2016-01-01
: from 02.01.2016T00:00 till nowggr stat -T 2016-02-01
: from begin of gerrit usage till 01.02.2016T23:59:59
-
ggr topic list -s
List all development branches and the repositories. With-s
it includes the commits in the branch likegit submodule summary
. -
ggr topic push [-b] [<BRANCHNAME>]
Push changes to gerrit. Without-b
its pushed to gerrit. With option-b
its pushed to a build server. Without branchname the current branch is pushed. -
ggr topic rename OLDTOPIC TOPIC
Rename OLDTOPIC to TOPIC- make OLDTOPIC optional, the current topic is renamed
-
reviewer per commit
-
reviewer per repository
-
status of branches
shows status of a branch (remote and local likegit remote show ...
ggr status [<BRANCHNAME>]
-
Support for
.repo
folder -
Consider to use https://github.com/gsingh93/trace
-
Consider to use https://github.com/ticki/termion
-
0.1.11 Document
gerritlib::call
module -
0.1.5 Add .travis.yml
-
This creates a dockercontainer which is connectable via http://localhost:8080.
The server is setup for development and all accounts can do all things.
It generate or use a DOCKER-FOR-GERRIT
folder containing of settings,
repositories and ssh-keys.
docker run --rm -it \
-h localhost
-p 8080:8080 -p 29418:29418 \
-v /development/projects/DOCKER-FOR-GERRIT:/var/gerrit/review_site \
--name gerrit \
openfrontier/gerrit:latest
- gerrit api documentation: https://gerrit-review.googlesource.com/Documentation/rest-api.html
- request, response design from: https://github.com/gefolderstsentry/sentry-cli
Licensed under
- Mozilla Public License 2.0 (LICENSE-MPL-2.0 or https://www.mozilla.org/media/MPL/2.0/index.txt)