refs/notes/review
is a special reference that Gerrit creates on repositories to store information about code reviews.
When a repository is cloned from Gerrit, the refs/notes/review
reference is not included by default. It has to be manually fetched:
$ git fetch origin refs/notes/review:refs/notes/review
It is also possible to configure git to always fetch refs/notes/review
:
$ git config --add remote.origin.fetch refs/notes/review:refs/notes/review
$ git fetch
This will add the refs/notes/review
to the default refspec in .git/config
:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/notes/review:refs/notes/review
url = https://gerrit.googlesource.com/gerrit
Note that the Gerrit server will need to have the "reviewnotes" plugin installed, for the extra ref to be available for fetching.
When refs/notes/review
is fetched on a repository, the Gerrit review information can be included in the git log output:
$ git log --pretty=fuller --notes=review
commit 8265bdba1fec42864af02c3081576118b69bad60
Author: Saša Živkov <[email protected]>
AuthorDate: Tue Jan 27 15:32:25 2015 +0100
Commit: Saša Živkov <[email protected]>
CommitDate: Tue Jan 27 15:32:25 2015 +0100
Update version to 2.10
Change-Id: I2795796ae77d240001fe5c789fe1aeae5fc34d56
Notes (review):
Code-Review+2: Saša Živkov <[email protected]>
Verified+1: Saša Živkov <[email protected]>
Submitted-by: Saša Živkov <[email protected]>
Submitted-at: Tue, 27 Jan 2015 15:31:27 +0000
Reviewed-on: https://gerrit-review.googlesource.com/63730
Project: gerrit
Branch: refs/heads/stable-2.10
With the patched git (review), you can use something like git log --pretty=fullest
to view it in a more natural format:
$ git --version
git version 2.4.0.1.gf6cd9a3
$ git log --pretty=fullest
commit 8265bdba1fec42864af02c3081576118b69bad60
Author: Saša Živkov <[email protected]>
AuthorDate: Tue Jan 27 15:32:25 2015 +0100
Commit: Saša Živkov <[email protected]>
CommitDate: Tue Jan 27 15:32:25 2015 +0100
Submit: Saša Živkov <[email protected]>
SubmitDate: Tue Jan 27 15:31:27 2015 +0000
Update version to 2.10
Change-Id: I2795796ae77d240001fe5c789fe1aeae5fc34d56
All the regular date formatting characters available to the author and committer dates are also available to the submitted:
%Sd
: submitted date (format respects --date= option)%SD
: submitted date, RFC2822 style%Sr
: submitted date, relative%St
: submitted date, UNIX timestamp%Si
: submitted date, ISO 8601-like format%SI
: submitted date, strict ISO 8601 format
The "review" patch for git can be found by doing a Compare in this branch: https://github.com/itension/git/tree/review