Ciro Santilli

Gerrit

https://www.gerritcodereview.com/

What to do on each repo to use Gerrit with it…

git config --local remote.origin.push HEAD:refs/for/master
curl -Lo .git/hooks/commit-msg http://review.example.com/tools/hooks/commit-msg 
git remote add ssh://<username>@gerrit-ring.savoirfairelinux.com:29420/ring-daemon
git config --local push.draft.url :refs/drafts/master
git config --local --add 'remote.origin.fetch +refs/changes/*:refs/remotes/origin/changes/*'

You must review every commit made before merging.

Anyone can make a pull request. Sign in with OAUTH, add an SSH key, and push there.

Created for Android. Still used? https://android-review.googlesource.com/

TODO browse source?!? Android uses GiTiles, so maybe not? https://code.google.com/p/gitiles/ https://android.googlesource.com/

Docs explain well how this (shitty >:-)) software works:

Internals

git clone https://gerrit.googlesource.com/gerrit

Official GitHub mirror: https://github.com/gerrit-review/gerrit

Install Ubuntu

http://stackoverflow.com/questions/10110247/how-to-install-gerrit-on-ubuntu-11-04/

Official deployment seems to be through a war file download (standard, portable and annoying Java Server Pages deployment).

Non-official from gerritforge https://www.linkedin.com/company/gerritforge-llp, a Gerrit service company:

echo 'deb mirror://mirrorlist.gerritforge.com/deb gerrit contrib' | sudo tee /etc/apt/sources.list.d/gerritforge.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1871F775
sudo apt-get update
sudo /etc/init.d/gerrit start
firefox http://localhost:8080

Currently running 2.12.

You can create and switch to infinitely many accounts, including admin, without password, from the top left corner Become link.

All diffs on the same page

On 2.12, when you hit Open All, it opens one diff file per new tab page… https://code.google.com/p/gerrit/issues/detail?id=938

Shows all non-merged ancestors and descendants of the change. Very confusing, since they should be seen as a tree, but they are shown linearly instead.

Same topic

TODO: this looks like Gerrit specific extra metadata that can be used to tag commits.

Not current

This was force pushed, either updated or removed.

Gerrit knows that something was updated on a force push because of the Change-Id on the commit message.

To get the most recent one, change e.g. Patch Sets (1/4) to the latest Patch Sets (4/4).

Edit mode

You can edit changes in the browser! Amazing for a system that has no web-view.

https://gerrit-review.googlesource.com/Documentation/user-inline-edit.html

Drafts

To back up changes that are not yet ready… use:

git push origin HEAD:refs/drafts/master

or:

git remote add draft ssh://<username>@gerrit-ring.savoirfairelinux.com:29420/ring-daemon
git config --local push.draft.url :refs/drafts/master
git push draft

The only thing this does is to hide the draft from everyone else. You can then explicitly allow individual people to see the draft.

Publish review line comments

Even that is hard.