Skip to content

kamaradclimber/gerritfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gerritfs

This gem allows to mount a gerrit as a filesystem. It aims to improve UX to operate reviews.

The original reasons to build this filesystem are:

  • efficiency. I am more efficient in my $EDITOR than in a web browser
  • avoid annoyances. Gerrit web UI catches my keys and prevents me to use my regular shortcuts

Usage

mkdir /tmp/gerrit
bin/mount /tmp/gerrit gerrit.yml

where gerrit.yml contains:

base_url: http://gerrit.mydomain
username: a.username
password: my_gerrit_http_password # see your preference on gerrit web interface

Tree mapping (ticked if implemented)

  • /my contains a list of reviews grouped by projects and a file named dashboard
  • /my/dashboard contains a small recap of all reviews with their status (score, verified)
  • /my/[group]_[project]/ contains a folder per review
  • /projects/[group]_[project]/ contains a clone of the project allowing easy browsing.

A review directory contains:

  • _INFO: all metadata linked to the review (author, reviewers, scores)
  • all patched files (including the commit message, named commit). Content of those file is not clear yet.
  • The diff can be seen by opening the hidden files with the basename prefixed by .0_ and .1_. See alias section.
  • _DISCUSSION: a summary of the discussion so far
  • _REVIEW.tmp: a temporary file listing all comments not published so far
  • CURRENT_REVISION: file containing the legacy id of the current revision

[ ] Moving _REVIEW.tmp to REVIEW should publish the comments to gerrit.

Comments are display inline with a header line: "Comment by xxx yyyy". Comments can be added by writing content on a new line after the line it refers to.

Of course this interface is going to change before being stabilized.

Status

  • list all repositories
  • list all reviews
  • basic "my" dashboard
  • can read reviews
  • can draft comments
  • can submit reviews (with score)

Aliases

To see the diff of a file in a review, you can use the following function:

review() {
  for f in $@; do
    dir=$(dirname $f)
    # keep the same current through the review
    current=${current:-$(cat $dir/CURRENT_REVISION)}
    name=$(basename $f)
    echo Reviewing $name
    vimdiff $dir/.0_$name $dir/.${current}_$name
  done
}

About

Proof of concept for a gerrit filesystem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages