tree: 1c138cbc8fa9ad6cd315c0fb8b824b399753b718 [path history] [tgz]

Gerrit code reviews for the Linux kernel

Gerrit is a modern code review system that supports:

  • patch series
  • versioned changes (no need to explain what changed)
  • change tracking (what's your open changes/changes to review)
  • side-by-side diffs (shows added/removed parts within a line too)
  • full file context (you don't miss bugs on error paths)
  • base repository/revision (you can apply patches locally)
  • web-based rebase and editing files/commit message (for minor edits)
  • preserving comments across versions and comment threads

and more. Refer to the User Guide and Gerrit Docs for more info, but the information below should be enough to get you started.

The instance consists of a set of mirrors of kernel git repositories, which you can see and browse at Review changes can be created only for the mirrored repos. Currently two dozens of the most active repos are mirrored, but this list can be easily extended if there is interest.

The second part is the review system at All uploaded changes are public and visible to everyone, however creating own changes and participating in reviews requires a Google account. To sign in into the review system, click Sign in link in the top-right corner. Once you signed in you can see your outgoing, incoming and CCed changes at the dashboard.

Use Cases

There are several potential use cases:

  • self-review: upload a change just to double check the handy side-by-side diffs
  • pre-review: you may do a pre-review within a team before sending the change upstream for the official review; or use it for some preliminary design discussions; or just keep track of progress and versioning
  • complement the current review process: include a link to the change into the upstream patch email as FYI (maybe after “---” line); this preserves the current process, but gives side-by-side diffs, full context, version diffs, base commit, change tracking, etc

Feel free to use it if you find it useful.

Note: when you upload a new change nobody is notified. You can add reviewers/CC manually and/or give the change link to other people.


To create a change for the net tree you need to:

  • clone the tree with:
git clone

or add a new remote with:

git remote add -f gerrit-net
  • Sign in into the gerrit instance using Sign in link in the top-right corner.

  • Click Generate Password link in the top menu. Copy-paste and execute the script which adds an auth cookie required for pushing changes for review.

  • Add gerrit commit hook to the git repo with:

(f=`git rev-parse --git-dir`/hooks/commit-msg; \
	mkdir -p $(dirname $f); \
	curl -Lo $f; \
	chmod +x $f)

The hook simply adds Change-Id: unique-id to commit messages, gerrit uses it to understand uploads of new versions of the same change.

  • Commit a change as usual:
git checkout gerrit-net/master
git checkout -b my-test-gerrit-change
sed -i "s#mm_init(#mem_init(#g" init/main.c
git commit -s --all -m "init: test change"
  • Push the change for review:
git push gerrit-net HEAD:refs/for/master

Pushing to the special path refs/for/target-branch creates a change based on the target-branch. The command output will contain the URL of the change, e.g.:

you should also see it on the dashboard.

  • Push a new version:
sed -i "s#mem_init(#mem_initialize(#g" init/main.c
git commit --amend --all --no-edit
git push gerrit-net HEAD:refs/for/master

Gerrit knows it's a new version based on the Change-Id tag. Now you can see the new version at:

as well as the diff between versions:

To create patch series simply push a branch with multiple commits.